我正在开发一个 web 项目的标题部分,我希望将链接卡在它的顶部。
这是HTML:
<div id="header_section">
<a class="toplink" href="#">Contact</a>
<a class="toplink" href="#">Register</a>
<a class="toplink" href="#">Staff Login</a>
<a class="toplink" href="#">Home</a>
<h1 class="welsh"> SAMPLE </h1>
<h1> SAMPLE </h1>
</div>
和CSS:
a.toplink
{
font-family: ‘Arial Narrow’, sans-serif;
font-size: 12px;
font-weight: bold;
position: fixed;
top: 0px;
right: 10px;
margin-right: 100px;
padding: 6px;
width: 100px;
text-align: center;
color: black;
background-color: #f3f3f3;
}
这已将链接移动到我想要它们的位置,但是当我想将它们彼此相邻显示时,它们都堆叠在每个链接的顶部。显示的唯一链接是“主页”,其余链接位于下方。有任何想法吗?