| | My question is, why would anyone use the CODE tag when you can use the PRE tag?
1. The PRE tag recognises white space, the CODE tag does not.
2. The CODE tag requires that you escape some chars, the PRE tag does not.
I cannot see anything that the CODE tag achieves that is special apart from sounding as though it is perfect for displaying code which IMO it is not.
Thanks.
|
Comment/Reply (w/o sign-up)
jlhaslip
May 5 2006, 06:39 AM
Semantically, the pre tag is for "pre-formatted" text, not neccesarly (sp?) code only. The "code" tag is semantically designated to apply to 'code'. There may be a difference in the selection of styling which the author may wish to apply for preformatted and code sections of the document, so there are two tags. Think of them as "classes", sort of. Looking back at the original WWW, the Internet was very different then. There were mostly text documents from Academics being passed around on the Web, and these were very distinctly identifiable requirements. The 'code' sections were typically displayed using a teletype style of character because the most common input device used then for remote access were modified teletype machines and their print type was very different from the print on typewriters, for example, so when the WWW came along, using the teletype font was used to indicate that code was being presented. Preformatted text could be displayed in any chosen type, not neccesarly the same font as code. Today, though, the code tag is a bit of an anachronism, I agree. You almost need to be my age to remember those times. I hope this clarifies why these two tags are used in HTML.
Comment/Reply (w/o sign-up)
Thanks, and such a quick and informed reply! I appreciate the historical context as I do enjoy reading about computer history, which isn't history at all in the conventional sense as it all seemed to happen just yesterday.
Comment/Reply (w/o sign-up)
jlhaslip
May 5 2006, 07:26 AM
Well, yes, sometimes it feels like it was just yesterday that I used a 'card punch' machine and hoped I didn't drop the stack of cards on the way to the 'card reader' machine thingy ... Then I wake up ... and the last thirty - some - odd few years come back into the databanks.
Comment/Reply (w/o sign-up)
Tyssen
May 5 2006, 11:02 AM
The code tag can also be applied to code that is written inline with other text and for which you don't want pre-formatting.
Comment/Reply (w/o sign-up)
nirmal_1288
Jun 8 2007, 05:36 AM
Okay so I have been getting a little better at HTML thanks to this site but, I ran into a problem. I have a marquee that goes the normal direction <-- that way. So I was wondering how can I make it so when the mouse hovers over the marquee it stops and people can view it.
Comment/Reply (w/o sign-up)
nirmal_1288
Jun 8 2007, 05:37 AM
Recently i installed joomla on my server, aswell as a bridge between SMF and Joomla. I previously had phpbb installed in the directory "http://techno-source.co.uk/phpbb" most user's use this link to access the forums, and some use just techno-source.co.uk . What i am looking for is a solution so that when user's type in techno-source.co.uk/phpbb and techno-source.co.uk it will load " http://techno-source.co.uk/Joomla" by default. I would prefer if it did not use mea redirection as its not very professional , is there any other way. Contacted my hoster, who told me they cannot do anything but look at .htaccess, however i do not know how this works. Thanks in advance.
Comment/Reply (w/o sign-up)
nirmal_1288
Jun 8 2007, 05:38 AM
Hi all - I bet this is a quick one, but it's new to me I tried to validate a page I just built in xhtml transitional and got errors on the use of   on my page. I've researched this afternoon and found other recommended code to use -   and/or 00A0 for a non breaking space instead but I'm still not able to validate. I am using the code as a space between several pictures I have on a page all in a row. Is there other code I should be using that will validate instead of  ? Maybe I'm just not using the code correctly - should I have it in quotes? " " or "00A0"? Thanks -
Comment/Reply (w/o sign-up)
jlhaslip
Jun 11 2007, 01:32 AM
QUOTE(nirmal_1288 @ Jun 7 2007, 11:38 PM)  Is there other code I should be using that will validate instead of  ? Maybe I'm just not using the code correctly - should I have it in quotes? " " or "00A0"?
Thanks - The Non-breaking Space requires a semi colon after the 'p'. CODE
Comment/Reply (w/o sign-up)
Similar Topics
Keywords : html, pre, tag, code, tag
- W3schools.com Is Down
Ask your CSS/HTML/PHP questions here... (8)
Html Code Question
(2) Hi all, I was wondering is there a way I could make a field in a form that will take you to the
address you enter in it? (in other words) Site: trap17.com (go) and clicking go takes you to
trap17. I will explain why. What I have done is set up a page with frames, I've got all my
most visited sites on the left, and I browse in the right, I want to make a frame up the top of the
browsing window that will be like the address bar, Just to retain this framed setup. (I will put a
google box in it too). Alot of you are probably wondering why, its for purely aesthetic....
Some Questions On Html
(10) I was just curious on how people here learned HTML or XML (assuming you did, which, judging by the
fact you are actually here on this board). How long did it take for you to learn the basics of HTML?
How proficient are you right now in HTML? Which resources did you use when you were learning HTML
(or are currently learning HTML?). How did you find learning HTML? Thanks.....
Help Making A Web Adress Bar Using Html/js
(9) Hey I need to make an adress bar basically you imput into the field press enter and your away but it
cant use php or any code that needs to be installed, its all part of a workaround for my school
interenet!....
Html Ascii Codes - A Complete List
downloadable php file (3) I was often frustrated at how, despite there being thousands of ASCII "special characters" such as
&8659; , websites that claimed to list them all only listed the first 256. To combat this issue, I
have created a table which lists the first 10,001 - from to &10000; I am sure there are many
more but it is simply not feasible to create a table with many more rows as viewing it would put
terrific strain on the browser.! You can download the file in two forms. One uses PHP to
dynamically create the table (1KB), the other has it ready-made in pure HTML format (437KB....
Html Div Help [resolved]
help with the divs in ipb (1) hey guys, as you may know, i have ipb 2.3.4 set up on my site. i am currently using the centura
skin and like it a lot. i have customised the header bar in terms of the logo, however also want a
slab of text linking to the forums home at the top of the banner. i have so far managed to achieve
this to work in firefox (see attached screenshot), however it just screws up in ie, opera and safari
(i think). the link is here here is the code, both html and css, of the ipb header, and i have
placed between stars the parts i have edited: CODE the css (only the edited....
Applet Code
(0) Hi There! ....
Best Way To Protect Html Form Fields
Looking for suggestions on how to protect form fields during user inpu (3) My working example is here http://sonesay.trap17.com/application.php The form submits to itself
and stores what ever the user inputs into session variables. Thats all fine and I have validation
checks for it, I wanted to add more and I remember comming across a site where they would lock from
fields to prevent any changes if the information was already supplied and validated. I'm looking
to build something similar but cant seem to figure out how to get that same effect at this time.
Heres my program logic so far application.php includes('application_content.....
Html Application Form
(6) does anyone know how to make a form/application that when you submit the form with the submit but it
sends it in a email to you email address if anyone on here knows please please let me know thanks, i
want this so i can have members apply for a team on my football site and there information will come
back to me and i can accept or reject them for that job....
I Need Help With This Code
(3) could some one help with this code. I have been working on this for the past hour trying to get it
to work. this is the first time i have had problem with writing html code. the code i need help
with is HTML a href =" http://www.darkzone3.110mb.com/contact.php " target=" _blank "> input
type =" image " height=" 27 " width=" 139 " src=" http://www.darkzone3.110mb.com/buttons/contact.png
" /> /a > for some reason on my page it want work at all it want even open it the same page.
What i'm trying to do with the code is a page in a new window using an image a....
Email Form Code
(8) I want to create my own e-mail form for my site and I don't quite know if JavaScript or PHP is
required. I use my Nintendo Wii to manage my sites so I only can use what my webhost allows. I am
using Angelfire for my main site and InvisionPlus for my forums. I'm planning on switching to
Trap17 for my main site. Well here is my current code. Please tell me what I need to change.
Message ....
Login In Using Html
(12) I have looked around and I can't find any code to help me out. I want to make it so you can log
in to my site to get member featues. Could some one please help me....
Wanna Learn Html From Scratch
downloade an online tutorial,formatted my c: lost it forever,and FORGO (5) id prefer something i can download .....coz my internet connection is highly intermittant Moved
from the Java section to the HTML section. ....
Help With Css/html Layout
Horizontal List Problems (5) I can't figure out why this horizontal list isnt working. Underneath my banner is supposed to
be a green gradient bar with a list of links in the center of the page. The links are all the way
to the left and are really small. The banner is also overlapping the list for some reason. This is
my current layout(don't worry, I'm not trying to advertise).
http://www.stormgaming.net/stormcreations/ This is my CSS file
http://www.stormgaming.net/stormcreations/storm.css Thanks in advance for any help.....
Having Html Troubles......
Please help! (1) I'm having troubles with the background colours on the HTML pages on my site
keri-j.trap17.com Basically, the colors are hex codes and i'm no HTML n00b, god no! But, I just
can't figure this one out! I have the background colour in the body tag (duh) " " on all my
pages but on some of them the background is white. This might be to do with some javascript i have
recently edited in each page or certain errors but whatever it is i can't figure it out! This
is my homepage with the correct background color This is my poetry page with the faulty colour c....
Wanting To Touch Up/learn My Html Again
(27) Ok, well recently i realized that i am not as skilled in HTML (such as building website layouts) as
i want to be, with tables etc... and so i was thinking about going through many many many many many
many sites and just touching up on my HTML and see if i can code my own website template before
starting to learn PHP because that is what i want to do. so, i am asking all of you experianced
people on trap17 what websites did you use to learn your HTML skills, yees i know i could go to
google and type in learn html or somthing along the lines of that, but i want to know wh....
Creating Link In Html - Help Me With This!
(5) edit: Neeeaavverrrminddd..... I was a total noob at php when i posted this and I needed help doing
something with bbcode in php and didn't really know what I was saying.. /blush.gif"
style="vertical-align:middle" emoid=":blush:" border="0" alt="blush.gif" /> Anyway topic
resolved.......
Realtime/wma Player In Websites
What's the code (6) Alright, I'm making a website for a band. And he requested on the "Media" page that when you go
there, you see there sample songs. And next to it, it's like "Song - Play in - MWA - RealTime."
How do you make it so when you click, say, realtime, it takes you to another page and the player is
right there, playing the song? I suppose this is some kind of PHP but I'm not sure. Links,
code, tutorials, anything to get this working for me is appretiated.....
Do You Know Html?
Just Wondering, most of you would know. (65) Well I was just wondering, i know this polol might sound stupid, as this is a hosting site forum and
the chances are you do know HTML, but the other day i met 2 people who didt have a clue what HTML
was, and was just at the forum because they found this forum active. And also do you know any other
programming languages, just wondering. I myself know HTML, C++ kinda, and learing PHP. Talking about
Languages I know Tamil, English, Lote /tongue.gif' border='0' style='vertical-align:middle'
alt='tongue.gif' /> .....
Integrating One Html File Into Another
without embedding (31) Hey guys I'm overhauling my website and have decided instead of using frames I want to just
have a logo and buttons integrated into each HTML file, so you can just scroll down past it. I want
the logo at the very top, before any content. I was wondering if there is any way of doing it with
an HTML tag (i.e. not PHP or any other scripts) so the header just gets inserted right after the
opening tag. I'm thinking that possibly it uses the tag, but really I don't have much of
an idea. Thanks in advance for your suggestions. Peace out /smile.gif' border=....
Html Templates
HTML Templates for website (4) Where do i get free HTML Templates to use in look and feel of website? Any link will be
helpfull....I know there are some free templates available but it is hard to find even by
gooooogling it. Please, share if you have any. Thank You.....
Html Editor
non WYSIWYG (22) What editor can I download and use that isn't a WYSIWYG(what-you-see-is-what-you-get) and is
free. Currently I use NotePad but I want something better.....
Html Cool Codes?
(7) hey guys..whats up..well i ws just wondering if you guys have any cool codes for myspace or
something..you know to design a page using html/css codes...see i tried googling around but all the
sites had the same thing..they dont have a unique one...i want like games in my page...like my
friend he had like tetris in his page..and i want a game// or anything like that to make my page
cool /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' />
anybody????plz...PEAcE!....
Redirect Code Help
(8) Can someone give me the code which redirects you automatically in the whole page instead of only in
the frame? I'm using this code, but it just redirects inside a frame... CODE But now
.tk has added a ad to the pages so I don't want to use it anymore, so I want that people
entering the site is being redirected to the "real" domain name now.......
Disable Scrollbars, Menubars Etc....
Javascript / Html code to disable them (7) hi, i would like to know how the scrollbars, menubars etc.. can be disabled. I hope someone can help
me with this. /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif"
/> Btw: can you tell me where the code should be inserted to? thanks! /cool.gif"
style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" />....
Whats The Best Code?
www.bpsite.tk (32) Whats you fav code?....
Css Or Html Tags
Which is better to use???? (24) Dear friends, I am new to web site designing. I am using NVU for creating my web
pages. It has a option in which we can select that the editor will use CSS or it will use html tags
for coding of the page. For example - If I want to make the text bold then if tag is used the code
will be QUOTE Your text and if the CSS is used the text will be QUOTE Your text .
Please suggest me which option I should choose to make my web page standard to modern HTML
standards. Thanks in advance.....
Colors in Html
everything about colors (9) Hey...I've had a few problems with choosin the color in html language. I found a good page wich
describes all you need to know.. http://bignosebird.com/colors.shtml Next thing you need and it
really is useful is a program that shows you the color code..you have it online here:
http://www.pagetutor.com/pagetutor/makapage/picker/ hope it helps ya....byeeeeee....
where did you learn html from?
(132) HI, i am intresting in knowing where you began learning html of what inspired you to start learning
html. which programs did you use or which progs dyu use?....
How To make Cool Inverted Table
neat little HTML trick Very Easy (7) This is a Very neat way to add a cool effect to your webpage! Its great for Holding Links......or
anything else you can find a use for it. CODE HtmlGoodies W3C Schools
Heres The same Code on a Page Take a Look:
http://www.geocities.com/xsilverboarderx/test.html Also here is My page that i am currently workin
on i used the same thing just switched colors and used CSS: Silver Design Of Course with this
code u can change things around for ex. like background, border width or color, and cellpadding
cellspacing for diffe....
Looking for html, pre, tag, code, tag
|
Searching Video's for html, pre, tag, code, tag
See Also,
|
advertisement
|
|