Jump to content

<code> tag


smiles

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...