English 中文(简体)
为什么我的标识会在菜单栏上显示?
原标题:Why my logo is displaying in menu bar?
  • 时间:2012-05-28 14:11:03
  •  标签:
  • html
  • css

请检查下面的代码

我的图像没有显示在菜单栏上 。 (长时间后使用 cs :)

HTML :

<html>
    <head>
        <link href="style.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <div id="navigation-container">
            <div class="rectangle">
                <div class="logo"/>
            </div>
        </div>
    </body>
</html>

CSS :

#navigation-container {
    margin: 0 auto;
    width: 1050px;
}

.rectangle {
    background: black;
    position: relative;
    height: 62px;
    -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.55);
    box-shadow: 0px 0px 4px rgba(0,0,0,0.55);
    -webkit-border-radius: 3px;
    margin-top:0em;
}

.logo {
    background:url( company_logo.png );
}

提前感谢

问题回答

您需要为您的 < code>.logo 设定一个高度和宽度。 < a href="http://jsfiddle.net/ymcSU/1/" rel=“ nofollow” 见这个 JSFiddle 。

注意 不能自闭, 您必须有一个 无效 HTML 。

id = # class = .

您需要更新您的 cs, 以便显示 .logo , 而不是 < logo

您的 HTML 应该是

Also, as you have not specified the height of .logo this will not work, I recommend you change it to: <div class="rectangle logo"></div>





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签