Answer the question
In order to leave comments, you need to log in
A few questions about landing page header layout. How to make a menu?
Hello. I'm laying out my first layout and I chose this for practice: www.freepsdhtml.com/download-mogo-free-one-page-ps... I'm currently laying out the page title (close-up):
<header>
<div class="container">
<div class="header_menu clearfix">
<p>MoGo</p>
<ul>
<li class="text_menu_item">
<a href="#">about</a>
</li>
<li class="text_menu_item">
<a href="#">service</a>
</li>
<li class="text_menu_item">
<a href="#">work</a>
</li>
<li class="text_menu_item">
<a href="#">blog</a>
</li>
<li class="text_menu_item">
<a href="#">contact</a>
</li>
<img src="images/1) header/shopping-cart-menu.png" id=cart_icon height="15" width="18"/>
<img src="images/1) header/magnifying-glass-menu.png" id=glass_icon" height="18" width="18"/>
</ul>
</nav>
</div>
</div>
</header>
body {
padding: 0px;
margin: 0px;
}
header {
background: url("../images/1) header/header.jpg") no-repeat center top/cover;
height: 600px;
}
.container{
width: 1200px;
margin: 0 auto;
}
.container .header_menu {
font-family: 'Montserrat', sans-serif;
color: white;
}
.clearfix:after {
content: '';
display: table;
width: 100%;
clear: both;
}
.container .header_menu p{
font-size: 30px;
font-weight: bold;
float: left;
}
nav{
float: right;
}
#cart_icon{
list-style: none;
float: left;
margin-right: 40px;
}
#glass_icon{
list-style: none;
float: left;
margin-left: 55px;
}
.text_menu_item{
list-style: none;
float: left;
margin-right: 40px;
}
.text_menu_item a{
color: white;
font-size: 14px;
font-weight: normal;
text-decoration: none;
text-transform: uppercase;
}
Answer the question
In order to leave comments, you need to log in
Your html markup is lame. Missing opening nav tag
Pictures inside ul tag
What is this ....? ((
<img src="images/1) header/shopping-cart-menu.png" id=cart_icon height="15" width="18"/>
<img src="images/1) header/magnifying-glass-menu.png" id=glass_icon" height="18" width="18"/>
Tie with floats. Layout with flex. Explore grids along the way.
1. So,
display:flex;
justify-content: space-between;
Thanks everyone for your answers. I got acquainted with flex and it is much better than working with float and clearfix:
now my code and page look like this
<header>
<div class="container">
<div class="header_full">
<p>MoGo</p>
<div class="header_menu">
<nav>
<li class="text_menu_item">
<a href="#">about</a>
</li>
<li class="text_menu_item">
<a href="#">service</a>
</li>
<li class="text_menu_item">
<a href="#">work</a>
</li>
<li class="text_menu_item">
<a href="#">blog</a>
</li>
<li class="text_menu_item">
<a href="#">contact</a>
</li>
</nav>
<img src="images/1) header/shopping-cart-menu.png" id="cart_icon" height="15" width="18"/>
<img src="images/1) header/magnifying-glass-menu.png" id="glass_icon" height="18" width="18"/>
</div>
</div>
</div>
</header>
*{
padding: 0px;
margin: 0px;
}
header {
background: url("../images/1) header/header.jpg") no-repeat center top/cover;
height: 600px;
}
.container{
width: 1200px;
margin: 0 auto;
}
.container .header_full {
display: flex;
justify-content: space-between;
align-items: baseline;
font-family: 'Montserrat', sans-serif;
color: white;
}
.container .header_menu{
display: flex;
align-items: normal;
}
.container .header_menu nav{
display: flex;
align-items: baseline;
}
.container .header_full p{
font-size: 30px;
font-weight: bold;
margin-top: 20px;
}
#cart_icon{
margin-right: 55px;
}
.text_menu_item{
list-style: none;
margin-right: 40px;
}
.text_menu_item a{
color: white;
font-size: 14px;
font-weight: normal;
text-decoration: none;
text-transform: uppercase;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question