我的分区:
<div id="dialog" class="window">
<table class="modalWindow" border="1">
<tr>
<td colspan="2"><input type="text" id="feedName" value="" /></td>
</tr>
<tr>
<td><input type="submit" id="renameFeed" value="Submit"></td>
<td><a href="#" class="close">Close it</a></td>
</tr>
</table>
</div>
需要样式<a href="#" class="close">Close it</a>
当前 div 使用 CSS。
怎么做?
最佳答案
这将仅设置具有 close 类(#dialog 的后代)的 a 元素的样式,这正是您想要的:对关闭文本的唯一控制,而不是所有链接文本
#dialog a.close {
/*insert css here*/
}
#dialog a.close:hover {
/*insert cool hover css here*/
}
关于html - 如何使用 css 为当前 div 设置标签样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30601848/