KingOfHeart Posted May 27, 2010 Share Posted May 27, 2010 I'm not sure if it's possible or not but I'd figure I should ask. I'm going to show some scripts in my tutorial. I need it to colorize certain words. Also I need it to display it by the amount of spaces and go to a new line when I press the enter key. In HTML it removes extra spaces unless if I use and it removes line breaks unless if I use <br>. So what is possible? Link to comment https://forums.phpfreaks.com/topic/203035-code-box-in-javacss/ Share on other sites More sharing options...
haku Posted May 27, 2010 Share Posted May 27, 2010 You can wrap it in a <pre> tag to preserve your spaces. And you can use the PHP function nl2br() to convert line breaks to <br> tags. Link to comment https://forums.phpfreaks.com/topic/203035-code-box-in-javacss/#findComment-1063952 Share on other sites More sharing options...
KingOfHeart Posted May 27, 2010 Author Share Posted May 27, 2010 It's on a computer so I can't use php. So you can colorize pre areas? Link to comment https://forums.phpfreaks.com/topic/203035-code-box-in-javacss/#findComment-1063953 Share on other sites More sharing options...
KingOfHeart Posted May 28, 2010 Author Share Posted May 28, 2010 Well thought of what I can do, but I forget the basic commands. I'm going to use plain text, combined with a span tag to be used as tabs, span tag to color certain words, and create some kind of border around this whole area with a div tag. So in a css file how would I draw a border? A tab in my file is "1.5em;" but what do I need to put for span? <div class = "code"> <span class = "blue">#include <<!>general></span><br> How do I set up the css file names? #div.code { < is this right? #span.code.blue < what about this? Link to comment https://forums.phpfreaks.com/topic/203035-code-box-in-javacss/#findComment-1064464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.