Hyp9r Hyp9r - 2 months ago 7
HTML Question

How to make image element go over navigation bar element

This is what I am trying to do
I was wondering how to make something like this. I know how to make the navigation bar by making an unordered list ect. But I was wondering how to make something like this? At least could you please explain me what's the concept? I've been looking around w3 and stackoverflow but didn't manage to find a solution....



body{
background-color:#ffffff;
margin:0;
}

.mainBar ul{
list-style: none;
margin:0;
margin-left: 150px;
padding:0;
overflow: hidden;
background-color: #fff;
}

.mainBar li {
float: left;
}

.mainBar li a{
display: block;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-family: monospace;
font-weight: bold;
font-size: 16px;
margin-top: 20px;
}

.mainBar li a:hover{
color:#5293D5;
}

.mainBar li a:active{
background-color:#fff;
}

.mainBar-pullRight{
margin-left: 800px;
}

.barTitle{
font-size: 35px;
color: #2ecc71;
margin-top:30px;
padding:0;
margin-bottom: 0;
}

.userBar ul{
list-style: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #2ecc71;
height: 70px;
}

.userBar li a{
display: block;
color: #ffffff;
text-align: center;
padding: 24px 26px;
text-decoration: none;
font-family: monospace;
font-size: 12px;
}


.userBar li{
float: left;
}

.d{
float: right;
font-size: 18px;
}

.userName{
color: #ffffff;
padding:24px 26px;
text-align: center;
font-family:"Courier New", Courier, monospace;
font-weight: bold;
font-size: 15px;
}

.profileShadow {
width: 100px;
height: 100px;
margin-left: 150px;
margin-top:5px;
margin-bottom:5px;
padding: 0;
overflow: hidden;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
text-align: center;
}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Instagram</title>
<link rel="stylesheet" href="style.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
</head>
<body>
<div class="wrapper">
<div class="mainBar">
<ul>
<li class="barTitle"><i class="fa fa-instagram" aria-hidden="true"> Instagram</i><a href="#1"></a></li>
<li class="mainBar-pullRight"><a href="#2">ABOUT</a></li>
<li><a href="#3">TERMS</a></li>
<li><a href="#5">GUIDES</a></li>
<li><a href="#8">SUPPORT</a></li>
</ul>
</div>
<div class="userBar">
<ul>
<li class="profileShadow"><i class="fa fa-user fa-3x" aria-hidden="true"></i></li>
<li class="userName">tomislav</li>
<li><a href="/signForDashboard">Change account</a></li>
<li><a href="/setEmail">Set email</a></li>
<li><a href="/logOut">Log Out</a></li>
<div style="float:right;" class="d">
<li><a href="/activity">Activity</a></li>
<li><a href="/profile">Profile</a></li>
<li><a href="/likes">Likes</a></li>
</div>
</ul>
</div>
</div>
</body>
</html>




Answer Source

Check This one made now. Concept is setting image position absolute.

It's not responsive.

https://codepen.io/shafikul-islam/pen/XaEgmZ