Acmlm's Board - I2 Archive - Programming - (X)HTML Height=100%
User | Post |
Modereb
Posts: 2/75 |
That's because height isn't a valid attribute in most cases. When talking about images or most other objects, setting a height in pixels will work, but percentages don't. <table> tags for example don't have a valid height attribute at all.
There is no direct way of having a background image and making it stretch 100% over a cell background. A nice sollution would be to have an image that 'fades' into a background color, and which would be centered in the cell background using CSS:
<td style="background-color:#000000; background-image:url('url/of/image.jpg'); background-repeat:no-repeat: background-position:center;"></td> |
BGenesis
Posts: 34/38 |
What's the different between HTML and XHTML? It should still allow height=""
EDIT: Oh, I saw that you were trying to give an IMAGE height=100%. This is not possible, as technically 100% is the actual height of the image [50% would be half the height] so the image can't stretch. |
Dragato
Posts: 25/25 |
Im trying to converting my site to XHTML as it doesn't look too good on Mozilla . But anyway, I have an image set to height=100% so it stretches as more text is entered. But it seems XHTML ignores the height and width... I tried using 'style=' but I can't set the height as a percentage.
What I need is a way to set the height of the image (currently background image in a table cell) to 100%, or a way to make it stretch that conforms to XHTML |
|