Web Design Forums

HTML and CSS Help

Having problems with these web design scripting? Ask here.

How can I display html and css code on a page?



Site of the Month Voting - Now Open. CAST YOUR VOTE NOW!

Reply
 
LinkBack Thread Tools
Old May 25 '09, 09:28 PM (#1)
mehashi is offline
New Member!
 
mehashi's Avatar
 
Join Date: May 2009
Location: UK
Posts: 2
mehashi is an unknown quantity at this point
How can I display html and css code on a page?

Hello ^_^

I have a website and part of it includes some basics of setting up a simple html page with a simple css style. The only problem is that I do not know what to do to display html code on the page in text format without the browser treating it as code.

At the moment I have written [html] for example and told people to replace the [ and ]'s with < and >'s but I do not like this solution. I believe there may be a way to tell the browser to treat the code as simple text but I do not know it.

PHP Code:
<html>
Something like this would be fine!
Without a box would be preferable though
If anybody could help me I would be very greatful! Thank you for your patience!
^_^b
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 26 '09, 06:05 AM (#2)
diddy is offline
[insert witty comment here]
 
diddy's Avatar
 
Join Date: June 2008
Location: Sydney, Australia
Posts: 495
diddy will become famous soon enoughdiddy will become famous soon enough
There was a tag, <pre></pre> I think it was called, but that was omitted in xhtml I think.

You could always put the text in a text area, like this:

HTML Code:
<textarea rows="30" cols="10">
<html>
text
</html>
</textarea>
There's probably a better way of doing this though. I'll think about it a bit more.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old May 26 '09, 09:02 AM (#3)
ravensjeff is offline
WDF Regular
 
ravensjeff's Avatar
 
Join Date: August 2007
Location: Maryland
Posts: 125
ravensjeff will become famous soon enough
A text area is the easiest method.

Otherwise you have convert all of your < to &lt; and your > to &gt; etc.

There are a couple of online tools that will do this for you. Here is one.

You should place your code inside <code></code> tags once you have it converted. You can then apply css to your code tags to style it as you like.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » HTML and CSS Help

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning HTML Kayo Coding Articles & Tutorials 10 December 30 '09 02:43 AM
CSS guide to horizontally and vertically centering text and page elements bfsog Coding Articles & Tutorials 2 March 4 '09 02:10 AM
[CSS] Customize your form with CSS - part 1 karinne Coding Articles & Tutorials 7 August 20 '06 10:38 PM
Lots of questions relating to HTML and CSS stargate3216 HTML and CSS Help 18 April 7 '06 05:26 PM

 
User Infomation
Your Avatar

Site Of The Month
Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:08 PM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164