徽标不会出现在bootstrap导航栏上

时间:2015-03-13 09:35:42

标签: html css html5 twitter-bootstrap

我正在练习引导程序,并且在显示未显示的徽标时遇到困难。你能看看并解释发生了什么吗?

HTML5:

    <!DOCTYPE html>
<html class="responsive">
    <head>
        <title>Whatcha Cravin? | Home</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta charset="utf-8">
        <link rel="stylesheet" href="assets\css\style.css" type="text/css">
        <link rel="stylesheet" href="assets\css\bootstrap.css" type="text/css">
        <link rel="stylesheet" href="assets\css\bootstrap.min.css" type="text/css">
    </head>
    <body>
    <!-- Navbar -->
        <nav class="nav">
            <div class="container">
                <div class="pull-left">
                    <a href="#">
                        <img href="assets/images/Logo_Transparent_Backround.PNG" class="image-responsive">
                    </a>
                </div>
                <ul class="list-inline pull-right">
                    <li class="list-unstyled"><a href="#" class="home">Home</a></li>
                    <li class="list-unstyled"><a href="#" class="menu">Our menu</a></li>
                    <li class="list-unstyled"><a href="#" class="about">About Us</a></li>
                    <li class="list-unstyled"><a href="#" class="contact">Contact Us</a></li>
                </ul>
            </div>
            <div class="jumbotron"/>
        </nav>
    <!-- /Navbar -->

    </body>
</html>

这是我不明白的地方,也许我的CSS不正确?

.nav li a{
    color: #000;
    font-size: 15px;
    font-weight: bold;
    padding:14px 10px;
    text-transform: uppercase;
}
.jumbotron{
    background-image:url(../images/image1-3-edited_1.jpg);
    background-repeat:no-repeat;
    background-size:cover;
    height:599px;
    margin-top:3px;
    width:100%;
}
.nav li a:hover{
    background-color:#b23739;
    color:#fff;
}
.nav{
    margin-top:10px;
    width:100%;
}
.logo{
    height:100px;
    width:200px;
    margin-top:-100px;
    overflow:none;
}
.list-inline{
    vertical-align:auto;
}

2 个答案:

答案 0 :(得分:2)

在img标签中将href更改为src。

答案 1 :(得分:0)

调用图像时需要使用

<img src="someImage.jpg" alt="" />

我在这里更改了代码是更新

http://jsfiddle.net/ccedgLqy/

<body>
<!-- Navbar -->
    <nav class="nav">
        <div class="container">
            <div class="pull-left">
                <a href="#">
                    <img src="http://www.xbox.com/shell/images/shell/XboxLogo.png" class="image-responsive">
                </a>
            </div>
            <ul class="list-inline pull-right">
                <li class="list-unstyled"><a href="#" class="home">Home</a></li>
                <li class="list-unstyled"><a href="#" class="menu">Our menu</a></li>
                <li class="list-unstyled"><a href="#" class="about">About Us</a></li>
                <li class="list-unstyled"><a href="#" class="contact">Contact Us</a></li>
            </ul>
        </div>
        <div class="jumbotron"/>
    </nav>
<!-- /Navbar -->

</body>

.nav li a{
color: #000;
font-size: 15px;
font-weight: bold;
padding:14px 10px;
text-transform: uppercase;
}
.jumbotron{
    background-image:url(../images/image1-3-edited_1.jpg);
    background-repeat:no-repeat;
    background-size:cover;
    height:599px;
    margin-top:3px;
    width:100%;
}
.nav li a:hover{
background-color:#b23739;
color:#fff;
}
.nav{
margin-top:10px;
width:100%;
}
.logo{
    height:100px;
   width:200px;
    margin-top:-100px;
    overflow:none;
}
.list-inline{
    vertical-align:auto;
}