Jump to content
xisto Community
Sign in to follow this  
mik

Html Question Concerning Pre Tag And Code Tag

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 " [url="http://forums.xisto.com/no_longer_exists/ 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.

Share this post


Link to post
Share on other sites

Hi all - I bet this is a quick one, but it's new to meI 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 -

Share this post


Link to post
Share on other sites

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'.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.