Click to See Complete Forum and Search --> : multiple selectors?


xtoverus1
04-15-2009, 06:16 PM
I'm not sure how to explain this since I'm pretty new to css but, if i want to style multiple things in a div like all the links in a ul and li, how would I do that?

#div ul, li, a:link, a:visited ?

OctoberWind
04-15-2009, 06:40 PM
Yup, you can specify multiple selectors on the same rule, by separating them with commas.

xtoverus1
04-15-2009, 06:43 PM
that doesn't work for me, I've tried it and the browser ignores it. I use FF3 and IE 8.

Declan1991
04-15-2009, 06:46 PM
Well you have the syntax right, do you want to show us more code (preferable the HTML that's supposed to be targeted and the full CSS selector), we probably can help.

xtoverus1
04-15-2009, 07:10 PM
HTML

<div id="menu"><!-- navigation links -->
<ul>
<li><a href="http://****.net" title="Home"><span class="spacer"><img src="images/home_btn.jpg" alt="home" width="71" height="16"/></span></a></li>
<li><a href="http://*****.net/bog" title="Blog" ><span class="spacer"><img src="images/blog_btn.jpg" alt="blog" width="54" height="22"/></span></a></li>
<li><a href="http://*****.net/gallery" title="Gallery" ><span class="spacer"><img src="images/gallery_btn.jpg" alt="gallery" width="87" height="22"/></span></a></li>
</ul>
</div>



CSS

#menu /*aligns the div under the header */
{
position: relative;
left: 130px;
width: 340px;
height: 40px;
}

#menu ul, li /*floats the links left */
{
list-style: none;
padding: 5px;
margin: 0;
float: left;
}

#menu a:link,a:visited,a:hover /*no a:link, a:visted border around the image links */
{
text-decoration:none;
color: white;
}

.spacer /* adds space between the image links */
{
padding: 10px;
}

xtoverus1
04-15-2009, 07:35 PM
You know I can make my site display decent in FF3,Safari and to a slightly lesser extent IE8. But when it comes to IE7 and below.... I'm about ready to give up. I tested my site on the first 3 and I was happy and then I seen it in IE7.. I couldn't believe what a mess that browser made of my code. I'm about ready to give up on anything less then FF3, Safari and IE8. I would like to make my site available to as many people as possible when I get it finished but this just getting ridiculous.