Nav appears four times


hey,why when there is unordered list within a <nav> tag. in the css file four nav selectors appears a nav selector, a nav ul selector, a nav li selector and finally a nav a selector.
thanks in advance,
Noob programmer.


Please provide a link to the lesson…


here it is:


If you look at a HTML document
you must be aware that the HTML-document is loaded into your Browser
following the rules of the Document Object Model in short the DOM

If you look at this HTML document you could make a diagram (it really helps)

         |                          |
        head                       body
         |                          |
 +-----+-+--+----+    +---------+---+-----+
 |     |    |    |    |         |         |
title meta link link header    div       nav
                      |         |         |
                   +--+-+  (6X)figure     ul
                   |    |       |         |
                  h1    p      img   +--+-+-+-----+
                                     |  |   |     |         
                                    li li  li    div
                                     |  |   |     |
                                     a  a   a     a

figure header


Thank you for answering my question but i still don’t really understand why there is four navs , im not understand what the a’s in the bottom of the diagram mean and to be honest i don’t understand how the DOM is related to my problem.


In the CSS environment
you use

comment out more then 1 line

Test each the impact of each of the =selector=
by using the commenting in your CSS file
and then use RUN to see the impact of each of the =rules=

nav {
  background-color: #FFF;
nav li {
  margin: 0;
  padding: 0 10px;
  display: inline;
nav ul {
  display: inline;

Use google search
to learn about the characteristics of each of the HTML Elements


I’m know what is anchor element unordered list element and navigator element. But just explain me why the nav appears four times. That is the only thing I wanna know!


If you ask nav appaers 4 times
do yu mean in the display…
do you mean in the CSS file…


I mean in the css file.


i mean in the css file.


Well did you test, as suggested in Nav appears four times
Look in the diagram presented to you in a separate post
1 to format the nav
1 to format the ul
1 to format the li
1 to format the div


Thank you! Now I’m understand why there four navs there.


Actually looking in the diagram
if they would have used
that would have had the same effect…as they are all unique

As long as it is clear to you
that the children / descendants inherit the CSS setting from the parent / ascendant


Yes. Thank you again.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.