Question

<!DOCTYPE html>
<html lang="fr">
<head>
    <style>
        aside#_left{
            width:239px;
            margin-left:0px;
            margin-right:1px;
            display:inline;
            position:fixed;
        }
        #content{
            padding-top:70px;
            padding-left:225px;
        }

        .menu01{
            background-color:#827F80;
            width:80%;
        }

        ul#nav{
            color:#6E7377;
            list-style-type:none;
            line-height:200%;
            padding-top:5px;
            padding-bottom:10px;
            margin:0px;
            padding:0px;
            text-align:center;
        }

            ul#nav li:hover{
                cursor:pointer;
                border-top:1px solid #7a9bb6;
                border-bottom:1px solid #7a9bb6;
                background:#5482a0;
            }

            #nav a:link{
                color:#6E7377;
                text-decoration:none;
                font-weight:bolder;
            }

            #nav a:hover{
                color:#78C6FF;
            }

            #nav li * {
                color: inherit;
            }

            #nav li:hover * {
                color: inherit;
                color:#78C6FF;
            }
    </style>
</head>
<body>
    <aside id="_left">
        <img src="images/logo.png" />
        <nav class="menu01">
            <ul id="nav">
                <li><a href="#">Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...</a></li>
                <li><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></li>
                <li><a href="#">Etiam interdum egestas nulla, ac dignissim urna suscipit non.</a></li>
            </ul>
        </nav>
    </aside>
    <div id="content">
        <p>
            Cras at dapibus mi. Vestibulum quis odio odio, a scelerisque mauris. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; 
            Ut ornare convallis elementum. Vivamus tincidunt malesuada lacus nec lacinia. Vestibulum lorem tortor, gravida sed convallis nec, dapibus ut leo. Donec id posuere leo. 
            Cras quis ante et dolor dictum euismod.
        </p>
    </div>
</body>
</html> 

Simply all I want is to populate the link font color from a li:hover. I suspect I'm just too lunatic...

Basically when the mouse go over the aside navigation panel I would like the text inside it to change, no matter what element are inside it, like <a>.

Update:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Status: completed, code updated

Was it helpful?

Solution

This depends on the elements inside of your li elements, but assuming you know what they are (in this case a):

#nav li:hover a {
     color: inherit;
}

Though depending on how the a:link, a:visited, a:hover and a:active states are defined the specificity of other selectors may override this declaration.

To be a little less precise, you can use the * wildcard selector:

#nav li:hover * {
     color: inherit;
}

But, again, this may be overruled by other, more specific, selectors defined elsewhere (especially if an id is used).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top