Results 1 to 2 of 2

Thread: *:lang(fr) HTML/CSS problem?

  1. #1
    Join Date
    Mar 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default *:lang(fr) HTML/CSS problem?

    Hi I am using the following code:
    HTML- my editor generates:
    <p>The German word for cat is <em xml:lang="de" >Katze</em></p>
    but I cant seem to get a style to work on this.
    This code works fine:
    <p>The French word for cat is <em lang="fr">chat</em></p>

    CSS I am using:
    *:lang(fr) { background-image:url(../css/flag/fr.gif);}
    *:lang(de) { background-image:url(../css/flag/gr.gif);}

    Questions:
    1. Is the XHTML correct/incorrect?
    http://www.websitedev.de/css/validator-faq - says:
    Your XHTML/XML document is not well-formed; it probably includes directly adjacent attribute specifications like:
    <div xml:lang="de"lang="de">
    ...
    This is not allowed in XML, there must be a white-space character between the attribute specifications, so write:
    <div xml:lang="de" lang="de">

    2. Is the CSS correct/incorrect?

    Many thanks

    Mike

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Instead of using a *:lang, I don't even know if thats valid, but replace it with a class, that might help, so try this:
    Code:
    <style type="text/css">
    .lang(fr) { background-image:url(../css/flag/fr.gif);}
    .lang(de) { background-image:url(../css/flag/gr.gif);}
    </style>
    <p>The French word for cat is <em class="lang(de)">chat</em></p>
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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