PDA

View Full Version : target a style sheet???


yashombi
10-12-2005, 04:33 PM
Can you target a style sheet to change the properties of a single tables attributes??

I have my site design and want to add a faded blue to white gif as the background image. Like this:

Test Page ('http://www.moviecardpeople.com/christos/')

This background image will be the background on which I want to put tables that hold the site information. Currently when the table is increased in size vertically the background image repeats. I am new to dreamweaver and am trying to grapple with the design format (use to using flash mx).

I have looked into answers to this problem and discovered CSS Styles sheets allow me to assign attributes to pages, and in the case of my repeating background allow me to control its presentation. But I do not want the effect on any of the other tables on my design.

I have tried playing with td, tr tags and had success in applying the change I want but too all tables. So......can I target the properties of a single table whilst not effect others????

Thanks

gmcrone
10-12-2005, 10:11 PM
In your style sheet give the table you want to have the background in, an id & name
then add the style like this:
table.named {background-image: url(mypic.gif) ;}

Don't forget to add the table name in the actual HTML file also

Mike....

yashombi
10-13-2005, 08:33 AM
This might be a dumb question but how do I add an id & name together on a single table??

Have added the id:main for my example but can't see how to name it?

yashombi
10-13-2005, 11:11 AM
No worries have worked it out. Only problem is the image displays in Explorer but not Safari?

Does anyone know why this might be??

The code I used was:


#main td {background-image: url(images/bkground.gif);
background-repeat: repeat-x;
background-position: left top;
}


main being my id name. Then just linked my style sheet....correct?? Is there anything i've missed that has altered the way it displays in different browsers?

Thanks, Y

domedia
10-13-2005, 02:44 PM
CSS code is correct.