SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question What´s wrong with this ?

    I need the fontsize to use smallfont which I have in the CSS of a vBulletin board, but if I add it directly it works, but doesn´t validate:

    Code:
    <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
     <tr>
    <td class="tcat" align="left">
     <a href=""><font color="#3366CC">Featured Topics</font></a>
      </td>
     </tr>
     <tr>
    <td class="alt2" align="left">
     <font color="#FFFFFF"><div class="smallfont">
    <a href="<A href="http://www.forum.com/showthread.php?t=73">Competition">http://www.forum.com/showthread.php?t=73">Competition: Create a banner for our site !</a>
    <br />
    <a href="<A href="http://www.forum.com/showthread.php?t=63">Read">http://www.forum.com/showthread.php?t=63">Read the transcript from the chat</a>
    </div>  </font>
      </td>
     </tr>
    </table>
    <br />

  2. #2
    Now available in Orange Tijmen's Avatar
    Join Date
    Jul 2004
    Location
    The Netherlands
    Posts
    1,469
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This typo was one of the reasons your code didn't validate
    Code:
    <a href="<A href="
    and
    Code:
    <td class="alt2" align="left">
     <font color="#FFFFFF"><div class="smallfont">
    isn't a really good way of writting code.
    Code:
    <td class="alt2, smallfont" align="left">
    Is shorter and it validates . You shoud/could also put the code from the smallfont class together with the alt2 class.

    Another thing is you could also specify in the css file which color should be used for "a" in each class, that way you don't have to type
    Code:
    <a href=""><font color="#3366CC">Featured Topics</font></a>
    , instead the "a" underneath the tcat class will automaticaly give the links the #3366CC color.

    Code:
    <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
     <tr>
    <td class="tcat" align="left">
     <a href=""><font color="#3366CC">Featured Topics</font></a>
      </td>
     </tr>
     <tr>
    <td class="alt2, smallfont" align="left">
    <a href="http://www.forum.com/showthread.php?t=73">Competition">http://www.forum.com/showthread.php?t=73">Competition: Create a banner for our site !</a>
    <br />
    <a href="http://www.forum.com/showthread.php?t=63">Read">http://www.forum.com/showthread.php?t=63">Read the transcript from the chat</a>
      </td>
     </tr>
    </table>
    <br />
    Travel Photos on Flickr - Twitter

    “Never give up. Never surrender”

  3. #3
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it !

    Thanks a lot.

  4. #4
    Guru Meditation Error gnarly's Avatar
    Join Date
    Dec 2003
    Location
    Cheltenham, United Kingdom
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    class="alt2, smallfont"
    Are you sure? I'm not convinced you want that comma in there.
    Olly Hodgson
    thinkdrastic.net

  5. #5
    SitePoint Guru wii's Avatar
    Join Date
    Sep 2004
    Location
    Denmark
    Posts
    720
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I did remove the alt2, is not necessary.

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,484
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    class="alt2, smallfont"


    Gnarly is correct and multiple classes must be separated by a space and not a comma.


    This typo was one of the reasons your code didn't validate Code:
    <a href="<A href="




    I'm afraid that it is the message board that corrupted the code as it tries to interpret links as links and ends up with a double link. I don't knw why it does that sometimes and not others but its a real pain .


  7. #7
    Now available in Orange Tijmen's Avatar
    Join Date
    Jul 2004
    Location
    The Netherlands
    Posts
    1,469
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never really used multiple classes before like that, i just placed it in the code and try'd if it would validate. And it did, so i assumed it was okay. Wil leave the comma out next time
    Travel Photos on Flickr - Twitter

    “Never give up. Never surrender”

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tijmen
    I have never really used multiple classes before like that, i just placed it in the code and try'd if it would validate. And it did, so i assumed it was okay.
    Here's a tip: don't trust that anything the validator says is valid actually is conforming. The validator only checks the syntax against a DTD, and DTDs aren't expressive enough to check whether classes are separated by whitespace or commas -- they can't even check whether the allowed characters are used. Most attributes in the DTD are just "CDATA" which basically means "anything goes", even though most attributes have particular constraints written in prose in the spec.

    Check with the spec instead, or at least use a validator that has a more expressive schema language.
    Simon Pieters


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
  •