Getsomepeaches
Getsomepeaches

Reputation: 1051

Styling .here class - ul div class

Every ul with the class .here will have these styles.

ul.here{
    border-left: solid 2px #c2c2c2;
    padding-left:5px;
}

However....

I would like the ul div #nav-sub with the class here to have these styles.

ul#nav-sub.here{
    border-left: solid 2px #c2c2c2;
    padding-left:5px;
}

How do I get this to work ?

Upvotes: 0

Views: 104

Answers (2)

Sebsemillia
Sebsemillia

Reputation: 9476

I guess from your description that

ul#nav-sub .here

could be the right CSS selector, as long as #nav-sub is unique as an id on this page.

jsFiddle

Upvotes: 3

bitoffdev
bitoffdev

Reputation: 3384

I think this is what you are looking for:

ul.here{
    border-left: solid 2px #c2c2c2;
    padding-left:5px;
}

ul.here #nav-sub{
    border-left: solid 2px #c2c2c2;
    padding-left:5px;
}

HTML

<ul class="here">
<li>item</li>
<li><div id="nav-sub">nav-sub</div></li>
</ul>

Upvotes: 0

Related Questions