我有一个使用类设置样式的 < div >。我想为其中的链接设置样式。我试过这个:
.categoryName {
border: 1px solid black;
padding-left: 10px;
padding-bottom: 10px;
border-radius: 5px;
}
.categoryName a:link {
color: black;
text-decoration: none;
font-weight: bold;
}
.categoryName a:visited {
color: black;
text-decoration: none;
font-weight: bold;
}
.categoryName a:hover {
color: green;
}
.categoryName a:active {
color: green;
}
认为它会工作,但它没有任何效果。试图用谷歌搜索答案,但只能找到有关一般样式链接的信息,而不仅仅是 < div > 类中的链接。