Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The "lang" attribute

    What exactly does the "lang" attribute of HTML elements do? Is it just informational, or has some other purpose?

    The following two sentences display the same content. What would one want to give the "lang" attribute for a particular span?

    <SPAN id="msg1" class="info" lang="fr">Variable d&eacute;clar&eacute;e deux fois</SPAN>

    <SPAN id="msg1" class="info" lang="en">Variable d&eacute;clar&eacute;e deux fois</SPAN>

    Well, i found this example while going through the HTML 4.01 specification.

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    India
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks.

    I found this in the HTML 4.01 specification:

    Language information specified via the lang attribute may be used by a user
    agent to control rendering in a variety of ways. Some situations where
    author-supplied language information may be helpful include:
    - Assisting search engines
    - Assisting speech synthesizers
    - Helping a user agent select glyph variants for high quality typography
    - Helping a user agent choose a set of quotation marks
    - Helping a user agent make decisions about hyphenation [p.96] , ligatures, and spacing
    - Assisting spell checkers and grammar checkers


  •  

    Posting Permissions

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