Html CSS-can';t位置导航链接高度右侧,去掉图像和主标题导航栏之间的额外边距
所以我无法摆脱图像和导航栏之间的这一点额外的空白。图像已设置为有2%的边距,但在图像和navibar之间有更多的边距。并在导航链接中添加填充,如在28.00时,guy设置Html CSS-can';t位置导航链接高度右侧,去掉图像和主标题导航栏之间的额外边距,html,css,Html,Css,所以我无法摆脱图像和导航栏之间的这一点额外的空白。图像已设置为有2%的边距,但在图像和navibar之间有更多的边距。并在导航链接中添加填充,如在28.00时,guy设置margin:0 auto至导航列表。这对我不起作用。他使用nav和和标签,我只是使用标签和创建菜单。如何修复此边距错误并在菜单栏上上下移动链接 CSS HTML 反应敏捷的 在奥托·奥利弗·奥尔戈(Otto Oliver Olgo)上出售post自动售货机 同侧眼睑 同侧眼睑 Ülemine侧边栏 我知道我的名字是什么 Ü
margin:0 auto代码>至导航列表。这对我不起作用。他使用nav和
和标签,我只是使用标签和创建菜单。如何修复此边距错误并在菜单栏上上下移动链接
CSS
HTML
反应敏捷的
在奥托·奥利弗·奥尔戈(Otto Oliver Olgo)上出售post自动售货机
同侧眼睑
同侧眼睑
Ülemine侧边栏
我知道我的名字是什么
Ülemine侧边栏
我知道我的名字是什么
版权和副本:2015年5月1日。版权所有
图像标签与内容内联显示,似乎在底部留出了额外的空间用于自然填充
如果您的img标记更新为在css中显示为块元素,则空间将消失:
.mainheader img {
width: 25%;
margin: 2% 0 0;
display: block;
}
要调整链接,您可以:
.mainheader nav a {
text-decoration: none;
color: white;
/* Set line-height to same as height will center text vertically */
line-height: 35px;
/* inline block make the whole height clickable */
display: inline-block;
padding: 0 10px;
}
哦,抱歉-忘了-如果我现在添加到css下一个属性:.mainheader导航{text decoration:none;color:white;padding:20px 25px;}然后向左和向右填充都可以,但是链接不会向上或向下移动。请添加style.css或使用html编辑器jsfiddle.net,以便我们可以查看到底是什么问题
.mainheader img {
width: 25%;
margin: 2% 0 0;
display: block;
}
.mainheader nav a {
text-decoration: none;
color: white;
/* Set line-height to same as height will center text vertically */
line-height: 35px;
/* inline block make the whole height clickable */
display: inline-block;
padding: 0 10px;
}