my site -> check it out.
Moderator: General Moderators
it shouldnt if you use an id on the <ul>
by doing this:
your saying:
"every element <a> inside the id named "navmenu" should be: display: block etc...."
so unless your using the id="navmenu" on more than one element(which your not supposed to do), it must work.
but if you do this (w/out using the id as a selector)
a {display: block; width: 100%; }
you would be assiging that style to every a tag in the document, which i doubt you want to do....
and btw- the width: 100% is only there for IE. display:block makes elements default to width: 100%, but were dealing w/ ie and it needs help
by doing this:
Code: Select all
#navmenu a { display: block; width: 100%; }
<ul id="navmenu">
<li><a>link</a></li>
<li><a>link</a></li>
<li><a>link</a></li>
</ul>"every element <a> inside the id named "navmenu" should be: display: block etc...."
so unless your using the id="navmenu" on more than one element(which your not supposed to do), it must work.
but if you do this (w/out using the id as a selector)
a {display: block; width: 100%; }
you would be assiging that style to every a tag in the document, which i doubt you want to do....
and btw- the width: 100% is only there for IE. display:block makes elements default to width: 100%, but were dealing w/ ie and it needs help
i looked at your css, untill this post i did not look at it, and didnt even know you had an id named "navigation". so when i said id="navmenu", i meant to create a new id
you could also do this:
and that would fix your problem.
your currently saying
apply the style to every <a> inside the id named "navigation"
when you want to say:
apply the style to every <a> thats also inside a <ul> inside the id named "navigation"
so just undo whatever you did, and add the style snippit in this post, and it will work
you could also do this:
Code: Select all
#navigation ul a {
display: block;
width: 100%;
}your currently saying
apply the style to every <a> inside the id named "navigation"
when you want to say:
apply the style to every <a> thats also inside a <ul> inside the id named "navigation"
so just undo whatever you did, and add the style snippit in this post, and it will work