Solved

HTML/CSS beginner with issues on "section"-tags and positions

Posted on 2014-01-24
1
307 Views
Last Modified: 2014-01-24
Hello all and thanks for reading this post!

I'm having a beginner issue with creating a simple site

I have been able to create and style a top fixed menu bar as I would like it, however, when I try to add a new section (e.g., the content of the page), the top menu overlaps and hides this text

My question is as follows:
How can I position the top menu bar to always be on top, while the next section (called "content" starts directly below it?

Thanks in advance!

HTML
<body>
<section id="navigation">
        <nav>
            <ul class="fancyNav">
                <li id="home"><a href="#home" class="homeIcon">Home</a></li>
                <li id="news"><a href="#news">News</a></li>
                <li id="about"><a href="#about">About us</a></li>
                <li id="services"><a href="#services">Services</a></li>
                <li id="contact"><a href="#contact">Contact us</a></li>
            </ul>
        </nav>
</section>

<section id="content">
This is where the main page will go
</section>

<section id="footer">
Things in the bottom footer
</section>
</body>

Open in new window



CSS
@charset "utf-8";

body {
    width: 900px;
    height: 100%;
    padding: 0;
}

/*********************************************************************************/
/* Nav                                                                           */
/*********************************************************************************/
nav {
	display: block;
	background-color: #434343;
	position: absolute;
	top: 0;
	left: 0;
	text-align: center;
	width: 100%;
	overflow: hidden;
}
nav > ul {
	display: inline-block;
	border-radius: 0.3em;
	box-shadow: inset 0px 0px 1px 1px rgba(255,255,255,0.25);
	padding: 0.5em 1.5em 0.5em 1.5em;
}
nav > ul > li {
	display: inline-block;
	list-style-type: none;
	text-align: center;
	padding: 0 1.5em 0 1.5em;
}

nav > ul > li > a {
	color: rgba(255,255,255,0.75);
	text-transform: uppercase;
	text-decoration: none;
	font-size: 0.75em;
	letter-spacing: 0.25em;

	-moz-transition: all .25s ease-in-out;
	-webkit-transition: all .25s ease-in-out;
	-o-transition: all .25s ease-in-out;
	-ms-transition: all .25s ease-in-out;
	transition: all .25s ease-in-out;
	
	outline: 0;
}
nav > ul > li:hover > a {
	color: #FF0072;
}
/*********************************************************************************/
/* Content                                                                         */
/*********************************************************************************/
section#page_content {
    width: 80%;
    margin: 0 auto;
}

/*********************************************************************************/
/* Footer                                                                        */
/*********************************************************************************/
footer#page_footer {
    position: absolute;
    height: 20px;
    width: 100%;
    left: 0;
    bottom: 0;
}

Open in new window

0
Comment
Question by:Cohagen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39808157
Remove position:absolute from nav{}
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question