dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: [RESOLVED] <tt> <samp> <code> <kbd>

  1. #1
    Join Date
    May 2006
    Location
    North of the South Pole
    Posts
    590

    resolved [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?

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    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

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    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.

  4. #4
    Join Date
    May 2006
    Location
    North of the South Pole
    Posts
    590
    Quote Originally Posted by felgall
    You should always use CSS to define the appearance of your page content
    Isn't it true that still in modern days some browsers don't support CSS?

    Which tag is actually made for monospace?

  5. #5
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles