|
|
#11 |
|
New Member
![]() Join Date: Jan 2012
Posts: 22
|
He that worked.
So i need to target the list within the class cat-meta. I was targeting the cat-meta. Why doesn't the CSS understand that? The list is still within the same class as I targeted first? |
|
|
|
|
|
#12 | |
|
Gold Member
![]() Join Date: Oct 2008
Location: Ireland
Posts: 349
|
Quote:
__________________
Conor Last edited by conor; 01-18-2012 at 05:54 AM. |
|
|
|
|
|
|
#13 |
|
Diamond Member
![]() Join Date: Feb 2011
Location: Newcastle, Australia
Posts: 1,137
|
Generally speaking for a nav list you would have four css selectors
ul ul li ul li a ul li a:hover Giving your ul display:inline wouldnt affect the ul li as their default style is inline:block, if you want your links to have a particular style you would target ul li a, likewise a style pertaining to the hover would only work on the ul li a:hover Without specifity your css uses the defaults. Which vary based on the browser (unless you use resets) this obviously is not preferred.
__________________
if (headhurts == "possibly") { alert ("keep going!"); } else if (headhurts == "yes") { alert ("go to sleep"); } else if (headhurts == "damn !@#$ mofo scripts...") { alert ("give up and have a beer!"); } else { alert ("watch TV"); } |
|
|
|
|
|
#14 | |
|
New Member
![]() Join Date: Jan 2012
Posts: 22
|
Because I use ul li a, CSS attacks the element within li and ul.
What I don't understand, is if I use inline: block for UL, why it doesnt attack everything in the UL? Wouldnt it use the CSS inline: block, instead of the default if I give it that code? Is it because it's too unspecific? Quote:
|
|
|
|
|
|
|
#15 |
|
Diamond Member
![]() Join Date: Feb 2011
Location: Newcastle, Australia
Posts: 1,137
|
ul {display:block;} would make the list behave like a block element (ie, stack on top)
ul {display:inline} would make the list behave like an inline element (ie not break to new line) However the list items (ul li) would still be display:block and still stack on top as you havent assigned a style to them. It just doesnt flow down like that. Its like suggesting you put display:inline on the body tag and assuming that everything contained within the body to therefore act as inline elements. It doesnt work like that. And for good reason too. Everything needs its own style assigned to it. Seriously read the initial tutorial link, it explains this concept much better than i can. I would also do a google search and find out what (by default) are block element and what are inline elements. <span> -inline, <div> - block for instance.
__________________
if (headhurts == "possibly") { alert ("keep going!"); } else if (headhurts == "yes") { alert ("go to sleep"); } else if (headhurts == "damn !@#$ mofo scripts...") { alert ("give up and have a beer!"); } else { alert ("watch TV"); } |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|