我一直试图让我的导航栏响应但我无法做到。任何帮助,将不胜感激。当屏幕宽度为700像素或更小(媒体查询)时,我需要将徽标放在左侧旁边,然后制作一个三明治图标,打开菜单。我知道还有其他问题,但没有一个符合标准。
.logo{
margin-left: 140px;
margin-top: 15px;
margin-bottom:10px;
height: 40px;
width: 40px;
float: left;
}
#logo1{
margin-left: 20px;
margin-top: 20px;
margin-bottom:10px;
height: 50px;
width: 150px;
float: left;
color: white;
font-family: 'Source Sans Pro', sans-serif;
}
header {
background: rgba(0,0,0,1);
width:100%;
z-index: 1000000;
position: fixed;
}
header::after {
content: '';
display: table;
clear:both;
}
nav {
display:inline-block;
float: right;
padding-right: 10%;
}
nav ul {
margin: 0;
padding:0 ;
list-style: none;
}
nav li {
display: inline-block;
margin-left: 70px;
padding-top: 28px;
position: relative;
}
nav a{
color: white;
text-decoration: none;
text-transform: uppercase;
font-size: 14px;
font-weight: 700;
}
nav a:hover {
color: #fff;
}
nav a::before {
content: '';
display: block;
height: 5px;
width: 100%;
background-color: #fff;
position: absolute;
top: 0;
width: 0%;
transition: all ease-in-out 200ms;
}
nav a:hover::before {
width: 100%;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="text/javascript" src="custom.js"></script>
<!--<script src="/jquery.scrollTo-2.1.2/jquery.scrollTo.js"></script>-->
</head>
<body>
<header>
<Div id="gg"><div id="header" class="container">
<img src="logo1.png" alt="logo" class="logo">
<!--<h1 id="logo1">SLAD </h1>-->
<nav>
<ul class="nav">
<li ><a href="#welcomesec" class="slide-section">Home</a></li>
<li><a href="#about" class="slide-section">About</a></li>
<li><a href="#portfolio" class="slide-section">Portfolio</a></li>
<li><a href="#clientssection" class="slide-section">Clients</a></li>
<li><a href="#contact" class="slide-section">Contact</a></li>
</ul>
</nav>
</div></Div>
</header>