CSS Help

Discussion in 'CSS' started by lostdog, Sep 11, 2007.

  1. #1
    We are making our site XHTML 1.0 Transitional and cant get it to validate. Can someone please help convert the following two items to css?

    1. <hr color="000000" size="6" />


    2. <td width="50%" align="center"><font color="#000000" size="+2">Sample Text</font></td>

    3. <table align="center" width="30%" cellspacing="1" cellpadding="5"
    border="2" bordercolor="#000000">
     
    lostdog, Sep 11, 2007 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    It's pointless (you using xhtml and getting everything all validated and crap) if you're still using tables for layout. I suggest you re-do the layout and not use a table. Don't try to make it valid with a table.
     
    soulscratch, Sep 11, 2007 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You'll probably have less code, too. The hr can be replaced for example with a border-top: 1px solid #whatevercolour for the divbox sitting under where the hr is (was).
     
    Stomme poes, Sep 12, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Heck, I'd go for XHTML Strict and just ditch all the nonsense presentational code alltogether. HTML (and XHTML) is a structural markup language - use it as such! :)
     
    Dan Schulz, Sep 12, 2007 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Well, the table is NOT necessarily the evil here - despite the anti-table mafioso's claims to the contrary.

    The problem I'm seeing is all that inlined presentation. That **** has got to go.

    Pretty much these days, if you use more than one BR in a row - /FAIL/... if you use a HR - /FAIL/ ... if you declare a width inline - /FAIL/

    If you use a FONT tag - /FAIL/ /FAIL/ /FAIL/ /FAIL/ /FAIL/ /FAIL/ /FAIL/ /FAIL/ /FAIL/ /FAIL/ at intarweb

    URL to the page in question (or the full sample recode?) and we all could probably point you along a lot further.

    If converting to a more modern coding technique, you should probably look into the concepts of 'separation of presentation from content' and 'semantic markup' - the net result is less code, cleaner code, reduced bandwidth consumption, easier to maintain, easier to change appearance, etc, etc, etc.

    Just going from HTML to XHTML is in itself pointless unless you need it XML parseable or want the stricter formatting rules for clarity. The REAL optimization you should be looking at is switching from 1997 HTML to 2007.

    Which with a HR, FONT and cellpadding/cellspaced TABLE is definately NOT what you've done.
     
    deathshadow, Sep 12, 2007 IP