[RESOLVED] <tt> <samp> <code> <kbd>
I always wondered:
What's the difference between <tt>, <samp>, <code> and <kbd>? Are there any more that provide monospace font in the same format as these?
Phrase elements, a question of semantics.
The font used by these elements is browser dependant, don't rely on them being monospace. It's always best to define the font in a css
You should always use CSS to define the appearance of your page content including the type of font to use. The correct way to use those tags is semantically based on what is contained within them eg. using <code> to contain a section of code that you want to display so as to identify that the content is code (in whatever programming language) and not regular human readable text.
Isn't it true that still in modern days some browsers don't support CSS?
Originally Posted by felgall
Which tag is actually made for monospace?
Currently the latest versions of all browsers understand all of CSS-1 and CSS-P. Only a few browsers support part of CSS-3 but most support at least part of CSS-2. Font selection was a part of CSS-1.
HTML is intended to identify what the various parts of your content are. Different browsers are free to choose how they display them unless you identify how you want it displayed. How you define the way that you want the page presented is to use CSS. Font selection is supported by all browsers that support fonts (eg. web readers don't and so ignore that part of the CSS).
Last edited by felgall; 06-23-2006 at 01:31 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)