我在頁面上有兩組不同的鏈接;一個在無序列表中,另一個在一個表中。我需要共享屬性,同時在表格中的鏈接在每個單元格中間對齊時具有不同的寬度。以下是我目前擁有的相關代碼。將屬性應用於CSS中的div中的類中的鏈接
.nav{
padding: 0;
margin: 0;
list-style: none;
vertical-align: bottom;
}
.nav a{
display: block;
width: 150px;
}
.nav a:hover{
background-color: red;
opacity: 0.6;
filter: alpha(opacity=50);
color: white;
}
我需要在頁腳的鏈接可具有不同的寬度的。以下是我所嘗試過的,但不起作用。目前,表格中的鏈接寬度爲150px,並與每個單元格的左側對齊。
#footer.nav a{
width: 250px;
}
乾杯
鏈接永遠不會有屬性寬度。 – ProllyGeek