【发布时间】:2016-06-16 11:24:57
【问题描述】:
我正在 notepad++ 上创建一个草稿网站,我希望在我的页面链接旁边的左上角(不是一直到左)有一个图像作为我的徽标。但是,当我通过 html 插入图像时,它会将最初位于顶部的文本链接向下移动。如何修复它以使链接保持在徽标旁边的顶部? (仍然居中) Green lines indicate the space it is creating
标志的HTML
<img src="Images/website logo draft.png" height="100" width="200"/>
HTML 超链接
<div class="linkstyle">
<a href="http://www.w3schools.com"> Home</a>
<a href="http://www.w3schools.com">Page 2</a>
<a href="http://www.w3schools.com">Page 3</a>
<a href="http://www.w3schools.com">Page 4</a>
<a href="http://www.w3schools.com">Page5</a>
</div>
CSS 链接样式
.linkstyle{
text-align: center;
font-family:Arial;
font-size: 30px;
}
更多链接样式
a {
color: white;
text-decoration: none;
}
【问题讨论】:
-
我的 img 边距设置为 50px,这会在我的三个底部图像之间创建空间。
-
jsfiddle.net/m11xrjz4 我的所有代码