我的标识图像作为左侧标题中的主页链接以及右侧的其他导航链接。但是,将“填充左侧”属性添加到属性的内联CSS时,徽标消失。在这里输入代码添加分页左侧时,标题中的CSS-Logo消失
奇怪的是,相同的代码(带有填充左侧属性)对于同一网站的其他页面的标题工作正常。
所以,在这里,S从当左填充为1%的快照: left-padding is 1%
从当左填充为3%快照: left-padding is 3%
如果你仔细观察,图像的右边界水平地固定在某个点上。所以当我增加左侧填充时,图像从左边压缩并变得更小。
我期待的是图像被移动到左边,完全没有被压缩。
下面的代码:
#header {
width: 100%;
height: 10%;
color: white;
background-color: #0066CC;
position: fixed;
top: 0;
left: 0;
}
<div id="header">
<a href="homepage.html"><img id="logo" src="logo.png" alt="HZ Innovations" style = "float: left; width: 5%; height: 100%; padding-left: 10%;"/></a>
<div id = "headLinks" style="float: right; position: absolute; bottom: 10%; right: 25%; ">
<a href="about.html" >About Hz</a>
<a href="technology.html">The Technology</a>
<a href="contactUs.html" >Contact Us</a>
</div>
</div>
这是否片断看起来像你想显示什么?这与你的问题有关吗? – Amit
是的,该代码段是不起作用的代码。我在谈论里面的logo.png没有显示。 @Amit – Divesh
我们需要一个带有实际图像的演示。同样,对于浮动和绝对位置,'headlinks div ...使用一个或其他...不是两个都没有意义。 –