[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2014-01-24
1
Medium Priority
?
309 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 2000 total points
ID: 39808157
Remove position:absolute from nav{}
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article discusses four methods for overlaying images in a container on a web page
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

650 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