I cannot get the main page’s navigation bar to the top of the second page. Margin and padding set to 0 did not work. I tried setting header position to absolute.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
nav {
width: 100%;
height: 75px;
line-height: 75px;
padding: 0px 100px;
position: fixed;
background-image: linear-gradient(#0094ff, #00ffff);
}
nav .logo p {
font-size: 30px;
font-weight: bold;
float: left;
color: #fff;
text-transform: uppercase;
letter-spacing: 1.5px;
cursor: pointer;
}
nav ul {
float: right;
}
nav li {
display: inline-block;
list-style: none;
}
nav li a {
font-size: 18px;
text-transform: uppercase;
padding: 0px 30px;
color: #fff;
text-decoration: none;
}
nav li a:hover {
color: #0026ff;
transition: all 0.4s ease 0s;
}
body {
background: #2397b1;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
position: relative;
width: 100%;
max-width: 1000px;
min-height: 1000px;
margin: 50px;
background: #ffffff;
display: grid;
grid-template-columns: 1fr 3fr;
box-shadow: 0 35px 55px rgba(0, 0, 0, 0.1);
}
.container .left_Side {
max-width: 1000px;
position: relative;
background: #0d5aad;
padding: 40px;
}
.profileText {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 21px;
border-bottom: 2px solid rgb(255, 255, 255);
}
.profileText .imgBox {
position: relative;
width: 199px;
height: 199px;
border-radius: 50%;
overflow: hidden;
}
.profileText .imgBox img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.profileText h2 {
color: #ffff;
font-size: 1.5em;
margin-top: 19px;
text-align: center;
text-transform: uppercase;
font-weight: 600;
line-height: 1.2em;
}
.profileText h2 span {
font-size: 0.8em;
font-weight: 300;
}
.contactInformation {
padding-top: 40px;
}
.title {
color: #ffffff;
text-transform: uppercase;
font-weight: 100;
letter-spacing: 1px;
}
.contactInformation ul {
position: relative;
}
.contactInformation ul li {
list-style: none;
position: relative;
margin: 10px 0;
}
.contactInformation ul li .icon {
display: inline-block;
width: 35px;
font-size: 15px;
color: aquamarine;
}
.contactInformation ul li span {
color: #000000;
font-weight: 300;
}
.container .right_Side {
position: relative;
background: #ffffff;
padding: 40px;
}
.about {
margin-bottom: 50px;
}
.about:last-child {
margin-bottom: 0;
}
.title2 {
color: #294ae9;
text-transform: uppercase;
letter-spacing: 1px;
margin-bottom: 10px;
}
p {
color: #000000;
}
.about .box {
display: flex;
flex-direction: row;
margin: 20px 0;
}
.about .box .year_Company {
min-width: 150px;
}
.about .box .year_Company h5 {
text-transform: uppercase;
color: #565454;
}
.about .box .text h4 {
text-transform: uppercase;
color: #2a7da2;
font-size: 16px;
}
.skills .box {
position: relative;
width: 100%;
display: grid;
grid-template-columns: 150px 1fr;
justify-content: center;
align-items: center;
}
.skills .box h4 {
text-transform: uppercase;
color: #565454;
font-weight: 500;
}
.skills .box .percent {
position: relative;
width: 100%;
height: 10px;
background: #f0f0f0;
}
.skills .box h4 .percent {
position: absolute;
top: 0;
left: 0;
height: 100%;
background: #2a7da2;
}
.skills .box .percent div {
position: absolute;
top: 0;
left: 0;
height: 100%;
background: #2a7da2;
}
<body>
<header>
<nav>
<div class="navbar">
<div class="logo">
<p>Navigation</p>
</div>
<ul>
<li><a href="./index.html">Home</a></li>
<li><a href="./indexresume.html">Resume</a></li>
<li><a href="./projects.html">Projects</a></li>
</ul>
</div>
</nav>
</header>
<div class="container">
<div class="left_Side">
<div class="profileText">
<div class="imgBox">
<img src="images/profile_pic.jfif" />
</div>
<h2>name<br /><span>Something here</span></h2>
</div>
<div class="contactInformation">
<h3 class="title">Contact Info</h3>
<ul>
<li>
<span class="icon"><i class="fa fa-phone-square" aria-hidden="true"></i></span><br />
<span class="text">phone</span>
</li>
<li>
<span class="icon"><i class="fa fa-envelope" aria-hidden="true"></i></span>
<span class="text"><span class="text">email</span></span>
</li>
<li>
<span class="icon"><i class="fa fa-linkedin" aria-hidden="true"></i></span>
<span class="text">linked in</span>
</li>
<li>
<span class="icon"><i class="fa fa-address-card" aria-hidden="true"></i></span>
<span class="text"><br />address</span>
</li>
</ul>
</div>
<div class="contactInformation education">
<h2 class="title">Education</h2>
<ul>
<li>
<span class="text">St. Cloud State University</span>
<span class="text">December of 2022<br /></span>
<span class="text">Bachelor of Science:<br />Information Systems</span>
</li>
</ul>
</div>
</div>
<div class="right_Side">
<div class="about">
<h2 class="title2">Summary Statement</h2>
<p>
blah blah
</p>
</div>
<div class="about">
<h2 class="title2">Work Experience</h2>
<div class="box">
<div class="year_Company">
<h5>ASM Global,<br /> U.S. Bank Stadium</h5>
<h5>Oct 2022 - Present</h5>
</div>
<div class="text">
<h4>Event Day Support Technician</h4>
<p>
Provide tech support during major events at U.S. Bank Stadium. Duties include troubleshooting ticket scanners, iPad deployment in suites and clubs, deployment of wireless network and mobile carts, support of televisions and telephones, and assist with
mobile app issues.
</p>
</div>
</div>
<div class="box">
<div class="year_Company">
<h5>name</h5>
<h5>2010 - Present</h5>
</div>
<div class="text">
<h4>Manager/Bartender/Server/Cook</h4>
<p>
blah blah
</p>
</div>
</div>
<div class="box">
<div class="year_Company">
<h5>company name</h5>
<h5>April 2021 - July 2022</h5>
</div>
<div class="text">
<h4>Server</h4>
<p>
blah blah
</p>
</div>
</div>
<div class="box">
<div class="year_Company">
<h5>Red Lobster</h5>
<h5>dates</h5>
</div>
<div class="text">
<h4>Server</h4>
<p>
blah blah
</p>
</div>
</div>
</div>
<div class="about skills">
<h2 class="title2">Skills</h2>
<div class="box">
<h4>Html</h4>
<div class="percent">
<div style="width:50%"></div>
</div>
</div>
<div class="box">
<h4>C#</h4>
<div class="percent">
<div style=" width:85%"></div>
</div>
</div>
<div class="box">
<h4>SQL</h4>
<div class="percent">
<div style="width:50%"></div>
</div>
</div>
</div>
<div class="about certifications">
<h2 class="title2">Certifications</h2>
<ul>
<li>
<span class="icon"></span>
<span class="text">CompTIA Linux+ (XK0-004)</span>
</li>
</ul>
</div>
</div>
</div>
</body>
so here is the html.
2
Answers
You did great by making your navbar fixed, however this is not enough. You still need to specify where you want to fix it in your page (in your case it’s in the top of the page):
Code to run:
I know you have your answer but here I submit an alternative to make your page more responsive and the CSS easier to understand.
float
in favor of grid layout and a bit of flexh2
,h4
etc. – comment in the CSS as to WHY for study/readingNot 100% sure on your desired layout and contents for the left, main, and right but you can easily move things around a bit