【发布时间】:2013-04-16 16:50:05
【问题描述】:
我在以下代码中的页面上有徽标
<h1 class="site-title">
<a class="logo custom-logo" href="url" title="Go to Site">
<img alt="Site" height="136" src="url" width="298">
</a>
</h1>
我已将left 属性添加到logo 样式
.logo {
display: inline-block;
line-height: 1;
vertical-align: middle;
}
这个
left: 400px;
但它被忽略了。 Chrome Developer tools 显示此样式处于活动状态,但图像显示在距浏览器窗口左侧零距离处。
为什么?
【问题讨论】:
-
因为它还在文档的流中,如果你想让它遵守左边,设置为
position: relative;
标签: html css developer-tools