dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: background image properties

  1. #1
    Join Date
    Feb 2006
    Posts
    3

    background image properties

    hi !

    I am designing a website. I have assigned a background image to a particular cell of a table, using the following code

    <table>
    <tr>
    <td background=image.jpg></td>
    </tr>
    </table>

    But the background image is smaller than the cell, so it is "tileD".
    Is there any option to set the background image in center of the cell, (both horizontally and vertically) so that it is not in "tile" mode?

    I know in css, we can set the background image of the HTML page in center, but I want to do this with the background image of the table's cell , not the HTML page.

    Omair

  2. #2
    Join Date
    Apr 2003
    Location
    Rosemount, MN
    Posts
    2,287
    You could do something like this:
    <td width="width of image" height="height of image" background=image.jpg></td>

  3. #3
    Join Date
    Feb 2006
    Posts
    3
    YES IT HELPED A LITTLE, BUT THE BACKGROUND IMAGE IS STILL TILED, CAN U PLEASE TELL ME HOW TO UNtile THE IMAGE. I WANT JUST ONE BACKGROUND IMAGE, NOT TILED

  4. #4
    Join Date
    Apr 2003
    Location
    Rosemount, MN
    Posts
    2,287
    try this. Im not 100% that it will work, but I can see it working in my mind.

    <td width="width of image" height="height of image" style="background-image: url ('image.jpg'); background-repeat: no-repeat;"></td>

  5. #5
    Join Date
    Feb 2006
    Posts
    3
    Yes It worked !!!!
    Thankyou so much , sir.
    could u also tell me how to align it in the middle, both vertivally and horizontally.

  6. #6
    Join Date
    Apr 2003
    Location
    Rosemount, MN
    Posts
    2,287
    <td width="width of image" height="height of image" style="background-image: url ('image.jpg'); background-repeat: no-repeat; background-position:center center"></td>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles