My problem is that in mobile view which is 320px wide, everything looks okay, but when I start manually scaling up, the nav won't stay in center. It just stays on the left side of the screen, when the right side gets bigger. Title (h1) scales up normally. Navigation "buttons" should remain with the same width till break which is 768px wide.
body {
background-color: #FAFAFA;
font-family: helvetica;
margin: 0;
padding: 0;
}
.title {
text-align: center;
font-size: 1.5em;
margin-top: 30px;
margin-bottom: 30px;
color: #626262;
}
/*** NAVIGATION ***/
.main-nav li {
list-style: none;
}
.main-nav a {
text-decoration: none;
background-color: white;
font-weight: 600;
color: #626262;
padding-top: 15px;
padding-bottom: 15px;
font-size: .75em;
display: flex;
display: inline-block;
width: 280px;
margin-top: 5px;
text-align: center;
margin-left: -20px;
}
.profile-icon {
height: 125px;
width: 200px;
}
/****** PORTFOLIO ********/
.main-content {
background-color: #FFFFFF;
}
<header class="main-header">
<div class="container">
<h1 class="title">Title1</h1>
<ul class="main-nav">
<li><a href="#">HOME</a>
</li>
<li><a href="#">PORTFOLIO</a>
</li>
<li><a href="#">CONTACT</a>
</li>
</ul>
<img src="images/responsive-layout-profile.png" class="profile-icon">
<p>Text field</p>
</div>
</header>
<div class="main-content">
<h2 class="title-two">PORTFOLIO</h2>
</div>