I have a class called .rightcol. Now i wanted to have independent ul, li, a, a:hover rules for .rightcol only. It would be different than the existing normal ul, li, a, a:hover rules. So i tried to make it this way.. <code>#rightcol ul (rules:here) #rightcol li (rules:here) #rightcol a (rules:here). #rightcol a:hover (rules:here) </code> and calling it from the html this way.. <div id="rightcol"><ul class="rightcol"><li><a href="#">links</a></div> but the rule isn't working. Its mixing with the general rules! How can i have two or styles for different divs? Any idea, help or link would be great help. Thanks. Note.. '(' means brace. Writing from my phone and doesn't have the character
css anchor rules?
first off you only need to apply the class to the parenting div where the ul and stuff will reside.
second when you call a class with css the proper format is
finished product would look something like the following:
second when you call a class with css the proper format is
| Code: |
|
.rightcol {code}; |
finished product would look something like the following:
| Code: |
|
<style type="text/css"> .rightcol { code: here; } .rightcol ul { code: here; } .rightcol ul li a { code: here; } </style> <div class="rightcol"> div stuff in here </div> |
| Gundamxxg wrote: |
| .rightcol ul li a {
code: here; } [/code] |
you can't exactly call CSS selectors who have been assigned to html elements [like in ur case ul, li, a]. In case you want them to have independent values you can use:
If you say wanna 'call' it, assign CSS values for a class inside a class, like:
the properties in this for example, will only apply to those elements which have a class 'links' and are set inside the hierarchy of element i.e are child to a parent element which has a class 'rightcol'.
| Code: |
|
.rightcol a {code}; .rightcol ul {code}; .rightcol li {code}; |
If you say wanna 'call' it, assign CSS values for a class inside a class, like:
| Code: |
|
.rightcol .links {code}; |
the properties in this for example, will only apply to those elements which have a class 'links' and are set inside the hierarchy of element i.e are child to a parent element which has a class 'rightcol'.
