|
|||||||||
|
Thread Tools | Search this Thread |
September 3rd, 2003, 05:30 AM | #1 |
Trustee
Join Date: Oct 2001
Location: Chigasaki, Japan.
Posts: 1,660
|
Stopping images from tiling.
I'm trying to figure how to use a background image in a table cell and stop it from tiling. Is there any html code that does this? I'm trying to get a small image in the lower right corner of a table cell to brighten up the page.
__________________
Adrian DVInfo.net Search for quick answers Where to buy? From the best in the business...DVInfo.net sponsors |
September 3rd, 2003, 09:30 AM | #2 |
Air China Pilot
Join Date: May 2002
Location: Vancouver, B.C.
Posts: 2,389
|
You can use .css to fix the position of the background image.
body { background: url(graphic.jpg) fixed no-repeat; } Make sure the edges of the graphic are the same colour as the background colour for the page or it will look funny. The easier way is to make the background image larger than the cel otherwise it will always repeat if the cel is larger than the image.
__________________
-- Visit http://www.KeithLoh.com | stuff about living in Vancouver | My Flickr photo gallery |
September 3rd, 2003, 06:23 PM | #3 |
Trustee
Join Date: Oct 2001
Location: Chigasaki, Japan.
Posts: 1,660
|
Thanks Keith, does that work for table cells or just the body of the entire page.
I'll give it a try and see how it goes.
__________________
Adrian DVInfo.net Search for quick answers Where to buy? From the best in the business...DVInfo.net sponsors |
September 4th, 2003, 09:45 AM | #4 |
Regular Crew
Join Date: Jul 2003
Location: Tucson, AZ
Posts: 63
|
You can apply a background image to just about any element in modern browsers, and set them to not repeat, etc.
It sounds like you want to target just one cell in your table. Id give that TD and id and in the CSS make a rule like: td#notile { background: url(graphic.jpg) no-repeat; } You don't need want the "fixed" part unless you want the image to remain stationary on the page (not scroll). The no-repeat is what keeps it from tiling. Then in the HTML the markup for that table cell would look something like: <td id="notile">Cell contents</td> Hope this helps!
__________________
--Mark |
September 4th, 2003, 11:04 AM | #5 |
Air China Pilot
Join Date: May 2002
Location: Vancouver, B.C.
Posts: 2,389
|
//You don't need want the "fixed" part unless you want the image to remain stationary on the page (not scroll). The no-repeat is what keeps it from tiling.//
Good correction. I was doing this last night and didn't cut it out of my example.
__________________
-- Visit http://www.KeithLoh.com | stuff about living in Vancouver | My Flickr photo gallery |
September 4th, 2003, 11:14 AM | #6 |
Regular Crew
Join Date: Jul 2003
Location: Tucson, AZ
Posts: 63
|
Heh. CSS and web design is my area of expertise, so that is why I had to jump in (not to correct, but to help out), since I don't have much to add to anything DV related. Yet.
Best,
__________________
--Mark |
September 4th, 2003, 07:54 PM | #7 |
Trustee
Join Date: Oct 2001
Location: Chigasaki, Japan.
Posts: 1,660
|
Thanks to both of you. I'll see how I go today. I really haven't kept up with my web work that much here in Japan so I really appreciate your input.
What about positioning? The default is top left of the cell but I want it in the bottom right.
__________________
Adrian DVInfo.net Search for quick answers Where to buy? From the best in the business...DVInfo.net sponsors |
September 10th, 2003, 09:18 AM | #8 |
Regular Crew
Join Date: Sep 2003
Location: Worcester, MA
Posts: 64
|
Then you can actually just add "bottom right" to the CSS entry.
td.notile { background: url(graphic.jpg) no-repeat bottom right; } Should put it right where you want. |
September 10th, 2003, 11:09 PM | #9 |
Trustee
Join Date: Oct 2001
Location: Chigasaki, Japan.
Posts: 1,660
|
Thanks guys, I fired up Dreamweaver MX and low and behold there it was.
__________________
Adrian DVInfo.net Search for quick answers Where to buy? From the best in the business...DVInfo.net sponsors |
| ||||||
|
|