Tell us what’s happening:
Good morning everyone,
I have css question. On my technical Documentation page, I am trying to bring my main text higher up on the page. Any help would be appreciated.
Good evening, When I reduce the aforementioned the page moves but it gets lost behind my nav bar… am not sure how to solve this still. I was thinking that maybe I need to give it a new layer by setting the position differently…?
I would get rid of the grouped selector targeting both the html and body and just use the body selector.
body {
/* remember to use a fall-back font */
font-family: lato, sans-serif;
/* Setting a font-size on the body is a good idea */
font-size: 18px;
margin: 0;
/* padding on the top/bottom, let the margin on the main element handle the horizontal spacing */
padding: 20px 0;
}
Then move the margin to the main element.
#main-doc {
margin-left: 240px;
}
It is often better to think of margin as from the element out, and not from its parent container in. That is, move the element by pushing on its outer container (or pulling with negative margin).
The nav element doesn’t belong inside the main element and should come before it in the source order. Move the nav out of the main element and put it before it.
I would prefer if your <header> elements contained heading elements (h1-h6). The header element does not substitute headings and as such you have no headings on the page. Which isn’t a good semantic document structure.
Thank you very much for your help! I completely understand what your saying in regard to semantic structure. I am still a little confused on css. Thank again.