基本上我正在为大学制作一个项目,我需要左侧的徽标,现在没有出现,右侧的nav
按钮和最右边的一些社交媒体图标,我还没有添加图标,因为我甚至无法正确使用这一部分。
我知道代码搞砸了,但这是我第一次使用CSS和HTML,如果我想在nav
项之间插入一个子弹,那可能吗?
Here是CodePen
head
<link rel="stylesheet" href="ab.css" type="text/css" />
<meta name="viewport" content="width=device-width, intial-scale=1.0">
<!-- Slider -->
<link rel="stylesheet" href="flexslider.css" type="text/css">
<link rel="stylesheet" href="ab.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="jquery.flexslider.js"></script>
<script type="text/javascript" charset="utf-8">
$(window).load(function() {
$('.flexslider').flexslider();
});
</script>
<body class="content">
<header>
<div class="navbuttons">
<div class="nav-main-wrapper">
<nav class="nav-main">
<ul>
<li><a class="logo" href="index.html"></a></li>
<li><a href="#">QUIET</a></li>
<li><a href="#">RAIN</a></li>
<li><a href="#">THOUGHTS</a></li>
<li><a href="#">CRAZY</a></li>
</ul>
</nav>
</div>
</div>
</header>
</div>
css
.navbuttons{
background:#0099cc;
position:relative;
padding: 30px 0px 33px 0px;
height: 60px;
margin-bottom: 10px;
}
header{
margin-top: 0px;
position: relative;
z-index:-1;
}
.branding img{
position: relative;
top: 0px auto;
float: left;
margin: 0px 0px 156px 0px;
}
.logo{
background: url("http://tinypic.com/r/30k62ae/5");
background-repeat:no-repeat;
height:140px;
display:block;
width:105px;
margin-top:-80px;
left: 30px;
margin-left: 30px;
padding: 0;
}
.nav-main-wrapper{
float:left;
min-width: 470px;
bottom: 300px:
margin: 22px 0px 22px 47px;
}
.nav-main{
float:left;
clear:both;
}
.nav-main ul{
float:left;
display:block;
font-size:22px;
}
.nav-main ul li{
display:inline;
color:#237dac;
font-family: LeagueGothic;
}
.nav-main ul li a{
color: #fff;
margin-left: 128px;
text-decoration: none;
}
.nav-main ul li a:hover{
color:#056495;
text-decoration: none;
}
.nav-main ul li:last-child:after{
content: "";
}
.nav-main ul li a {
white-space: nowrap;
text-decoration: none;
}
@font-face {
font-family: LeagueGothic;
src: url('LeagueGothic-Regular.otf');
}
答案 0 :(得分:3)
您将徽标链接到http://tinypic.com/view.php?pic=30k62ae&s=5,这不是图片,而是页面。
答案 1 :(得分:1)
请尝试以下CSS:
body{
margin: 0 auto;
padding: 0;
}
.navbuttons{
background:#0099cc;
position:relative;
padding: 30px 0px 33px 0px;
height: 60px;
margin-bottom: 10px;
}
header{
margin-top: 0px;
position: relative;
z-index:-1;
}
.branding img{
position: relative;
top: 0px auto;
float: left;
margin: 0px 0px 156px 0px;
}
.logo{
background: url("http://tinypic.com/r/30k62ae/5");
background-repeat:no-repeat;
height:140px;
display:block;
width:105px;
margin-top:-80px;
left: 30px;
margin-left: 30px;
padding: 0;
float:right;
}
.nav-main-wrapper{
min-width: 470px;
bottom: 300px:
margin: 22px 0px 22px 47px;
}
.nav-main{
float:left;
clear:both;
margin:-46px 0 0 ;
}
.nav-main ul{
float:left;
display:block;
font-size:22px;
margin:0px; padding:0px;
}
.nav-main ul li{
display:inline;
color:#237dac;
font-family: LeagueGothic;
}
.nav-main ul li a{
color: #fff;
margin-left: 128px;
text-decoration: none;
}
.nav-main ul li a:hover{
color:#056495;
text-decoration: none;
}
.nav-main ul li:last-child:after{
content: "";
}
.nav-main ul li a {
white-space: nowrap;
text-decoration: none;
}
@font-face {
font-family: LeagueGothic;
src: url('LeagueGothic-Regular.otf');
}
下面的HTML源代码:
<body class="content">
<div class="navbuttons">
<div class="nav-main-wrapper">
<div class=""> <a class="logo" href="#"> Your Logo</a></div>
<nav class="nav-main">
<ul>
<li></li>
<li><a href="#">QUIET</a></li>
<li><a href="#">RAIN</a></li>
<li><a href="#">THOUGHTS</a></li>
<li><a href="#">CRAZY</a></li>
</ul>
</nav>
</div>
</div>
</body>
答案 2 :(得分:0)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<style>
body {
margin: 0px;
padding: 0px;
}
.menu {
width: 100%;
height: 100px;
background: #333;
}
.menu ul {
float: left;
margin: 0px;
padding: 0px;
}
.menu ul li {
list-style: none;
float: left;
padding: 0px;
background: #333;
}
.menu ul li:hover {
background: #555;
}
.menu ul li a {
display: block;
padding: 40px
}
.logo {
padding: 0px !important;
}
</style>
<body>
<div class="menu">
<ul>
<li><a class="logo" href="#"><img src="http://oi41.tinypic.com/30k62ae.jpg" width="119" /></a></li>
<li><a href="#">text</a></li>
<li><a href="#">text</a></li>
</ul>
</div>
</body>
</html>