smiles Posted June 14, 2007 Share Posted June 14, 2007 Hi !!! Could anyone tell me what is the function of <code> tagSeems that it is <code>"something"</code> is not much different to write "something" onlyhttp://www.w3schools.com/tags/tryit.asp?fi...ryhtml_phraseelThanks Link to comment Share on other sites More sharing options...
Anders Moen Posted June 14, 2007 Share Posted June 14, 2007 Well, you use this around code Link to comment Share on other sites More sharing options...
Elnof Posted June 14, 2007 Share Posted June 14, 2007 Sorry, can't display the code tag on here, but It's basicly like the <PRE> tag. Link to comment Share on other sites More sharing options...
boen_robot Posted June 14, 2007 Share Posted June 14, 2007 No, it's not.<code> exist for semantic's sake. It's used to define that what's inside it is some sort of code for the user to read, in whatever programming language. It doesn't really "do" anything in the essence "p" doesn't do anything different then "div". The difference is only semantics... ok... there's also a small appearance change, but should not consider it. "code" text is displayed with a more typewriter like font (and while I'm on the div and p... p leaves a little more margin). Link to comment Share on other sites More sharing options...
croatiankid Posted June 14, 2007 Share Posted June 14, 2007 No, it's not.<code> exist for semantic's sake. It's used to define that what's inside it is some sort of code for the user to read, in whatever programming language. It doesn't really "do" anything in the essence "p" doesn't do anything different then "div". The difference is only semantics... ok... there's also a small appearance change, but should not consider it. "code" text is displayed with a more typewriter like font (and while I'm on the div and p... p leaves a little more margin).And besides, you can style it to your liking like any other element. Link to comment Share on other sites More sharing options...
smiles Posted June 15, 2007 Author Share Posted June 15, 2007 I just hope that when you write <code><b>Hello</b></code>it will look like <b>Hello</b> Link to comment Share on other sites More sharing options...
boen_robot Posted June 15, 2007 Share Posted June 15, 2007 I just hope that when you write <code><b>Hello</b></code>it will look like<b>Hello</b> It won't. The only way to display special HTML characters remains to use entities. That is an ampersand (&) followed by either the name of the entity or sharp (#) and character number, after which there's a semicolon( ; ). Like this:<b>Hello</b> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.