|
Subject:
|
background images
|
|
Posted By:
|
Larson
|
Post Date:
|
2/14/2004 3:44:21 PM
|
I can't find my HTML book and have forgotten a couple of things, I'm using a background.gif in the td tags and I don't want it to repeat as the cell gets larger, do I use absolute positioning in the td tag or just say "no-repeat" ex: src="tbl1.gif" no-repeat="true"
secondly, I have a banner .gif that I also want to put into a <td> that will contain the same background .gif how can I do this effectivly.
Thanks in advance Larson
I think.....therefore..I code
|
|
Reply By:
|
richard.york
|
Reply Date:
|
2/14/2004 4:48:10 PM
|
I would suggest using CSS.
The syntax goes like this:
CSS Shorthand: background: color image repeat attachment position;
Individual declarations: background-color: white; (color|transparent) background-image: url('path/to/image.jpg'); background-repeat: no-repeat; (repeat|repeat-x|repeat-y|no-repeat) repeat: Image is tiled horizontally and vertically repeat-x: tiled horizontally only repeat-y: tiled vertically no-repeat: Image appears just once
background-position: center bottom; Keyword positioning (x: left|center|right) (y: top|center|bottom) background-position: Xpx Ypx; (Absolute positioning) background-position: X% Y%; (percentage relative to containing element) background-attachment: fixed; (fixed|scroll) fixed: stay put when scrolling scroll: scroll with window
Example using CSS with individual declarations: <td style="background-color: white; background-image: url('fish.jpg'); background-repeat: no-repeat; background-position: center bottom; background-attachment: fixed;"> Some content </td>
Example using CSS background shorthand: <td style="background: white url('fish.jpg') no-repeat fixed center bottom;"> Some content </td>
BTW: 'fixed' in this example will only work in NS/MOZ browsers, whereas it will only work if used on the <body> element when used in IE.
hth, Rich
::::::::::::::::::::::::::::::::: Smiling Souls http://www.smilingsouls.net :::::::::::::::::::::::::::::::::
|
|
Reply By:
|
Larson
|
Reply Date:
|
2/15/2004 5:22:21 PM
|
I thought about CSS, then decided against it, I'll take your advice and use it ;-),, thx Larson
I think.....therefore..I code
|