Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    67
    Member #
    13752
    I looked on the w3schools website for how to add a background image to a table cell and it gave an example of using the "background" attribute as shown below.
    However, this does not validate. Can anyone think of why this might be or perhaps sugguest an alternative?

    Line 30, Column 39
    : there is no attribute "background".
    HTML Code:
    <td rowspan="2" width="15%" background="images/column-right1.gif">
    Thanks.

  2.  

  3. #2
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    You can use CSS.

    You can use an inline style (which is bad practice, but will get the job done for you):

    <td rowspan="2" style="background: url(images/column-right1.gif) no-repeat; width: 15%;">

    Or you can add a class to it and place your CSS in the header.
    Code:
    <html>
    <head>
    <title>Page</title>
    <style type="text/css">
    .rightcol {
       width: 15%;
       background: url(images/column-right1.gif) no-repeat;
    }
    </style>
    </head>
    <body>
    ...
    <td rowspan="2" class="rightcol">
    ...
    </body>
    </html>

  4. #3
    Member
    Join Date
    Aug 2006
    Posts
    67
    Member #
    13752
    thats worked. thanks!

  5. #4
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    No problem.

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    It's highly recommended that you move that into an external stylesheet, though.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:08 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com