Well, I'm almost valid but

Discussion in 'HTML' started by Larry Webb, Jan 6, 2005.

  1. Larry Webb

    Larry Webb Guest

    I can't figure out how to change the problem below so my site will validate.

    URL - http://www.lockboxdoorprotector.com/

    Problem - there is no attribute "BACKGROUND"
    Code - <td background="images/layout_r7_c1.jpg">

    Thanks
    Larry
     
    Larry Webb, Jan 6, 2005
    #1
    1. Advertisements

  2. Larry Webb

    Matt James Guest

    Larry,
    Hi, I speak from recent and bitter experience re this.
    You'll need to use css to define the table background, instead of stating it
    in the way you have.

    I did find a number of useful websites giving examples of this... I'll try
    to track them down again and re-post.

    In the meantime, try a google search for "css table background" or similar.

    Cheers,
    Matt
     
    Matt James, Jan 6, 2005
    #2
    1. Advertisements

  3. Larry Webb

    Mark Parnell Guest

    Solution - remove the attribute "BACKGROUND"
     
    Mark Parnell, Jan 6, 2005
    #3
  4. Larry Webb

    Karl Core Guest

    Seems pretty self-explanatory to me...
     
    Karl Core, Jan 6, 2005
    #4
  5. Larry Webb

    Simon Guest

    Simon, Jan 6, 2005
    #5
  6. <style>
    td.whatever {background-image: url(images/layout_r7_c1.jpg)}
    </style>

    <td class="whatever"></td>
     
    Starshine Moonbeam, Jan 7, 2005
    #6
  7. Larry Webb

    Neal Guest

    A meta-comment, if I may, to you and/or whoever discovers this in a
    search of the archives:

    Your subject says that "you" are almost valid. Suggestion - don't
    attach yourself to your code to much. I realize it's just a figure of
    speech, but so many times I see people post here and it goes a little
    like this:

    A: My page won't work.
    B: This is wrong and this should be changed to that.
    A: Waa! You're mean!

    And the whole of the problem is people take criticisms of their code
    as if they were criticisms of themselves. We see it every day.

    You are a totally valid and good person; you are loved, loving and
    worthwhile. It's your code that sucks, that's all. Avoid mixing the
    two up, so that when your code is criticized, you don't take it
    personally.
     
    Neal, Jan 7, 2005
    #7
  8. Larry Webb

    rf Guest

    What are you after? A free martini? :)
     
    rf, Jan 7, 2005
    #8
  9. Larry Webb

    Neal Guest

    rf, man, who do you think you're talking to?

    I'm after TWO free martinis.
     
    Neal, Jan 7, 2005
    #9
  10. Larry Webb

    Richard Guest

    <td style="background:url('mages/layout.jpg')">
     
    Richard, Jan 7, 2005
    #10
  11. Larry Webb

    rf Guest

    Ah. One for me as well :)
     
    rf, Jan 7, 2005
    #11
  12. Larry Webb

    Neal Guest

    Um.. yeah! One for each of us!
     
    Neal, Jan 7, 2005
    #12
  13. Larry Webb

    Neal Guest

    Shouldn't that folder be named "magi"?
     
    Neal, Jan 7, 2005
    #13
  14. Larry Webb

    rf Guest

    I would think

    <td style="background:url('mages/layout_r7_c1.jpg')">

    and probably

    <td style="background-image: url('mages/layout_r7_c1.jpg')">
     
    rf, Jan 7, 2005
    #14
  15. Larry Webb

    SpaceGirl Guest

    No... that's not the recommended CSS shorthand. That wont validate on
    some validators, or at least it'll warn you.

    <td style="background: url('mages/layout_r7_c1.jpg')">

    ....is the recommended technique. You can then easily combine formatting
    without bloating the CSS;

    <td style="background-image: url('mages/layout_r7_c1.jpg');
    backgrond-color:#ffffff;">

    ....becomes...

    <td style="background:#fffff url('mages/layout_r7_c1.jpg');">

    Much smaller, and you can use this for other formatting too, such as
    borders etc.


    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
     
    SpaceGirl, Jan 7, 2005
    #15
  16. Larry Webb

    Richard Guest

    I left out the numbering on purpose.
    I was merely showing the format of the proper coding.
     
    Richard, Jan 7, 2005
    #16
  17. Which "that" is not recommended, and by which recommendation?
    Calling CSS checkers "validators" is already confusing; no need to add
    to the confusion by referring to them without specifying which checker
    does what.
    But that _is_ a shorthand, whereas the one with background-image, which
    you seem to frown upon, is _not_ a shorthand.

    The reason why background is better than background-image alone is that
    you should always set background color, background image, and content
    (text) color together*), and background always sets the background
    color too. But background-color can be set separately too. _And_ the
    color property needs to be set separately, so merely using the
    background property doesn't solve the problem.

    *) I'm too tired to explain the reason to this in detail, but any good
    CSS book or tutorial does that. You haven't understood the basics of
    CSS before you understand _why_ those properties should be set together
    if at all.
    Yes, but the latter is not equivalent to the former - it sets more
    properties.
     
    Jukka K. Korpela, Jan 7, 2005
    #17
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.