0

基本上我正在为大学做一个项目,我需要左侧的徽标,现在根本没有出现,右侧的nav按钮和最右侧的一些社交媒体图标,我还没有添加图标因为我什至不能把这部分弄好。

我知道代码搞砸了,但这是我第一次使用 CSS 和 HTML,如果我想在项目之间插入一个项目符号,nav这可能吗?

是 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');
}
4

3 回答 3

3

您将您的徽标链接到http://tinypic.com/view.php?pic=30k62ae&s=5这不是图像,而是页面。

将其链接到http://oi41.tinypic.com/30k62ae.jpg

于 2013-06-22T06:10:53.530 回答
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>
于 2013-06-22T06:05:14.527 回答
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>
于 2013-06-22T06:46:18.553 回答