SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: code in content of page?
-
Sep 24, 2006, 03:24 #1
- Join Date
- Oct 2005
- Location
- London
- Posts
- 1,678
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
code in content of page?
HI there,
I want to put some code in to my web pages content. I mean i want to display some code in amongst a paragraph of text.
Ive never done it before and searched it in google and found the xmp tag, which works but has caused 8 errors on validation against my strict dtd.
Any ideas how i can do this in a valid way?
Code:<p class="geek"><xmp><geeky rant begins></xmp></p>
-
Sep 24, 2006, 04:03 #2
- Join Date
- Apr 2005
- Location
- Regnvm Serviæ
- Posts
- 181
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This ought to serve the purpose:
Code:<code>geeky rant here</code>
http://mpt.net.nz/archive/2004/05/02/b-and-iBe not too sure that none of the old magic endures...
-
Sep 24, 2006, 04:05 #3
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Between the opening and closing paragraph tags, enter the following code (the example is just that, an example, and should be replaced with your own code):
HTML Code:<code>This is an <img /> tag.</code>
Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Sep 24, 2006, 04:07 #4
If you want < or > to come out on the page, you have to escape them:
HTML Code:<code><geeky rant begins></code>
-
Sep 24, 2006, 04:22 #5
- Join Date
- Oct 2005
- Location
- London
- Posts
- 1,678
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thats great guys. dont know how i never come accross that before.
woo-hoo! "This Page Is Valid XHTML 1.0 Strict!"
Bookmarks