我有一个页面,其标题导航正确继承,因此它将到达中心。
但是没有正确左侧的徽标,它会转到页面的左侧。
HTML
<title>VRBO</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main_layout">
<div id="header_menu">
<center>
<a href="#"><img src="images/nav_header.png" width="900" height="43" /></a>
</center>
</div>
<div id="header_logo">
<img src="images/logo.png" class="logoImage" width="96" height="96" />
</div>
</div>
</body>
</html>
CSS
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
a {text-decoration:none;}
body {
}
h1,h2,h3,h4,h5 {
font-family:Verdana, Geneva, sans-serif; font-weight:normal;
line-height:100%;
margin-top: 0;
}
#main_layout {
background-image: url(images/vrbo_bg.jpg);
background-repeat: no-repeat;
background-position: center top;
height: auto;
min-height: 100%;
min-width: 900px;
left: 0px;
top: 0px;
position: fixed;
width: 100%;
}
#header_menu {
overflow:hidden;
width: 100%;
}
#header_menu img {
float:inherit;
margin:0px;
}
#header_logo {
overflow: hidden;
width: 100%;
float:inherit;
margin:0px;
}
#header_logo img.logoImage {
float: left;
margin-left: 10px;
}
还能告诉我我做错了吗?
感谢!!!
答案 0 :(得分:1)
将标识放在header_menu div中,你应该没事;如果那是你想要的地方(在标题图片上)。
查看this jsfiddle我将logo设置为float:left和menu to float:右在标题div中,它充当元素的容器。在示例中,margin: 0px auto
使页眉在页面上居中(因此您不需要中心标签),只要给出宽度和高度。如果要在标题div中调整徽标或菜单的位置,只需添加边距属性即可。
答案 1 :(得分:0)
我不知道它是否与您的问题有关,因为您没有发布任何HTML - 但您在}
定义中遗漏了#header_menu
。