I'm trying to figure out how to keep my #header fixed in position without it expanding in width. Despite checking my code multiple times, I can't seem to identify the factor causing my header to become wider and shift downwards unexpectedly. I initially set it as 70% width and don't modify the width anywhere else afterwards.
Is there a way to maintain my header's fixed position with the correct width of 70%, preventing any sudden shifts? Additionally, is there a more efficient method than what I currently have to align "My name" and the navigation side by side within the #header, with the name on the left and the nav on the right?
HTML5:
<body>
<section id="Header" class="group">
<header>
<h2><a href="http://www.epicforever.com">My Name</a></h2>
</header>
<nav class="main">
<ul class="group">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</section>
<section id="TopContainer" class="group">
<p>Welcome to my Portfolio</p>
<p>Webdevelopment is my passion and I'd love to design and develop a website for you
sometime!</p>
<div class="block1">
<header><h2>Brand</2></header>
</div>
<div class="block2">
<header><h2>Web</h2></header>
</div>
<div class="block3">
<header><h2>Design</h2></header>
</div>
<aside><p>See all projects<a href="#">// brand // web // print</a></p></aside>
</section>
CSS3:
html {
width: 100%;
}
body{
background-image: url("img/bg.png");
font-family: arial, 'Lucida Sans Unicode';
font-size: 87.5%;
line-height: 15px;
color: #000305;
}
#Header, #TopContainer, #MidContainer, #AboutContainer, #ContactContainer{
width: 70%;
margin: 0 auto;
}
#Header{
padding: 0 10% 0 10%;
background-color: #fff;
margin-top: -8px;
position: fixed;
}
#Header header h2 {
padding-top: 13px;
}
#Header nav{
text-align: right;
}
#Header nav ul li{
list-style: none;
display: inline-block;
padding: 5px;
}
#TopContainer{
height: 150px;
padding: 0 10% 10% 10%;
background-color: #fff;
margin-top: 90px; /* change this at the end*/
}