Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to get only one image as background?

Status
Not open for further replies.

vanbeugen

IS-IT--Management
Feb 4, 2005
62
0
0
NL
In the HTML I have set a background-image as background for a table cell. I have made that table cell as wide as the total screen. The image itself is not that wide, so the image repeats itself. Is there a way to let the image take the dimensions of the cell (in this case the total screen), so that there is only one big image as background?
 
No. You can however stretch the picture if it is in an <img> tag.
 
The draft CSS3 spec includes some great additions for background images - including stretching, multiple images, etc.

It's a shame they won't be widely supported for a while yet, though.

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Can't you specify the background repeating pattern in CSS, such as "background-repeat: no-repeat" (or repeat-x, or repeat-y) ? I haven't tried it on a whole page, but I seem to remember seeing it on a table background, and if you wrap the whole page in a table with 100% width/height, mightn't that have the same effect?
 
background-repeat does just that: it repeats the image. the op has asked if it is possible to stretch the background image to be the size of the parent element, and, as Vragabond has pointed out, this is not yet possible using CSS, but can be accomplished with the <img> tag.

*cLFlaVA
----------------------------
[tt]I already made like infinity of those at scout camp...[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top