Drew 0

Hi,

What does the following css definition mean? Is it defining css for elements that have an id of 'main-nav' and elements with an id of 'watch-link?

#main-nav #watch-link a
{
    width: 98px;
    height: 40px;
    display:block;
    color:#5babdd;
 }

2 answers

1
point
This was chosen as the best answer

it targets any <a> elements that are inside a container with id="watch-link" which is also inside a container with id="main-nav" it's very specific.

i.e.

<div id="main-nav">
    <ul>
        <li id="watch-link">
            <a href="#">here is a link that would be styled</a>
        </li>
        <li>
            <a href="#">here is a link that would not be styled</a>
        </li>
    </ul>
</div>

Is it defining css for elements that have an id of 'main-nav' and elements with an id of 'watch-link?

no,

that would look like:

#main-nav,
#watch-link
{
 width: 98px;
 height: 40px;
 display:block;
 color:#5babdd
}
Answered over 6 years ago by Tony Crockford
Drew 0
0
points

Thanks for the detailled answer :)

Answered over 6 years ago by Drew