0

I'm not quite sure how to word it but I have a group of tags I want to style

nav->ul->li->a but I'm not sure what the syntax is to specify it I've tried just about every combination I can think of

current code:

<!DOCTYPE html>
<html>
<head>
    <title> Site One</title>
    <meta charset="UTF-8"/>
    <style>
    .firststyle {
    background-color:black;
    color:white;
    margin:20px;
    padding:20px;
    }
    .nstyle {
    backgroud-color: black;
    color: orange;
    margin:20px;
    padding:20px;
    nav,ul,li,a:link { color: orange; }
    }
    </style>
</head>
<body>
    <div class="firststyle">
    <center>
    <h1> Site One</h1>
    </center>
    <div class="nstyle">
    <nav>
        <ul style="list-style: none;">
            <li><a href="p_one.html">Page One</a></li>
            <li><a href="p_two.html">Page two</a></li>
        </ul>
    </nav>
    </div>
    <p>
    This is my testbed for HTML5/CSS and Javascript
    </p>
    </div>
</body>
</html>

Combinations I've tried:

nav > ul > li > a:link { color: orange; }

nav, ul, li, a:link { color: orange; }

nav.ul.li.a:link { color: orange; }

nav ul li a:link { color: orange; }

nav + ul + li + a:link { color: orange; }
2
Contributors
4
Replies
13
Views
2 Years
Discussion Span
Last Post by Xecantur
0

Not sure what you want to make orange, but you have on line 18 a CSS block in another CSS block. That is not going to work.
Take it out of that CSS block.

.nstyle {
    backgroud-color: black;
    color: orange;
    margin:20px;
    padding:20px;
}

.nstyle nav a:link { color: orange; }

Edited by gentlemedia

0

my understanding was that was a class and that sub blocks of CSS would work ? the intent was to make a class that would stylize the nav bar links ie change them to orange but I suppose that might not be possible?

0

oh wait, just noticed you did what I was looking for, didn't see the .nstyle class in front of the rest, guess it pays to do a double take ;p thanks, I wasn't aware you could add to the class outside the scope, coming from C++ CSS is pretty weird ;p thanks again

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.