Solved

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

Posted on 2014-01-24
1
305 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
1 Comment
 
LVL 58

Accepted Solution

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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

776 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