如何使图像元素超过导航栏元素

时间:2017-08-20 17:50:05

标签: html css

This is what I am trying to do 我想知道如何制作这样的东西。我知道如何通过制作无序列表等来制作导航栏。但我想知道如何制作这样的东西?至少你可以解释一下这个概念是什么吗?我一直在环顾w3和stackoverflow,但没有设法找到解决方案......



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>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

  

现在检查这个。概念设置图像位置绝对。

It's not responsive.

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