異なるウェブページへのリンクが画像の上に縦に並んでいるウェブサイトを作りたいと思っていますが、それらの間には<br>
があります。 position:absolute;
を使用してリンクがHTMLの上に重なり合っている理由
.image-wrapper {
position: absolute;
width: 250px;
}
.image-wrapper a {
position: absolute;
left: 0;
top: 0;
padding: 20px;
border: 0;
width: 98px;
height: 30px;
color: #FFF;
margin: 0px;
text-decoration: none;
font-family: "Abel";
font-size: 160%;
}
<div class="image-wrapper">
<img src="side bar.png" alt="sometext" />
<a href="harsh_projects.html"> Projects </a>
<br>
<a href="harsh_resume.html"> Resume </a>
<br>
<a href="harsh_contact.html"> Contact Me </a>
</div>
'ポジション:absolute'は、同じ場所にすべてのアンカータグを入れています。 –
これと戦うのではなく、リストの代わりに 'ul'要素を使うのはなぜですか?箇条書きを削除して、あなたが望むように 'li'をスタイルすることができます。 –