在網站中放置徽標的有效方法是什麼?在HTML5中使用徽標的正確方法
<a href="#" class="logo"></a>
和CSS
a.logo
{
display: block;
background-color: transparent;
background-image: url("images/logo.png");
background-position: center center;
background-repeat: no-repeat;
width: auto;
height: auto;
}
OR
<a href="#"><img src="images/logo.png"></a>
我建議第二個更好 –
我會使用img標籤。更適合用戶(可能想要保存徽標)或在搜索引擎中編制索引。 – JoeMecPak
我第二個建議。另外,'a.logo'選擇器可能不需要'a'部分,它可以只是'.logo'。 –