Solved

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

Posted on 2014-01-24
1
306 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

733 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