You are not logged in.

#1 2011-08-31 01:34:27

Draucia
Member
Registered: 2011-06-05
Posts: 128

[SOLVED]Small CSS question

I know this isn't probably the right place for this question, but I rather post this small question here then a whole separate html/css forum. :$

I've been sorta experimenting with css and I want my list to be horizontal, and a different color, and have padding.

#nav ul, li, a {
        text-decoration:none;
        list-style:none;
        display:inline;
        text-transform: uppercase;
        color: #BBDBFF; 
        font-family:Arial;
        font-size:25px;
        padding:5px;
}

I want ul, li, and a to have that style ONLY in nav. The code above works, but it also makes every other list on the page like that (so my sidebar links have that sort of style).

sidebar links:

#sidebar a {
        text-decoration:none;
        font-family:Arial;
        color:#BBDBFF;
        font-size:12px;
}

How can I apply the styles only to one div (#nav)?

Last edited by Draucia (2011-08-31 10:59:58)

Offline

#2 2011-08-31 03:13:17

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 859
Website

Re: [SOLVED]Small CSS question

You're looking for this:

#nav ul,
#nav li,
#nav a {
  ...
}

"#nav ul, li, a" is parsed as "#nav ul" OR "li" OR "a".

Offline

#3 2011-08-31 10:59:44

Draucia
Member
Registered: 2011-06-05
Posts: 128

Re: [SOLVED]Small CSS question

Thanks a lot tavianator. Solved my problem. smile

Offline

Board footer

Powered by FluxBB