如何使用 css 为当前 div 设置标签样式?
How to style a tag for current div with css?
我的div:
<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>
需要为当前 div 使用 css 样式 <a href="#" class="close">Close it</a>
。
怎么做?
这将仅设置带有 class close 的 a 元素的样式(它们是#dialog 的后代),这就是您想要的:对您的关闭文本的唯一控制,而不是您所有的link文字
#dialog a.close {
/*insert css here*/
}
#dialog a.close:hover {
/*insert cool hover css here*/
}
我的div:
<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>
需要为当前 div 使用 css 样式 <a href="#" class="close">Close it</a>
。
怎么做?
这将仅设置带有 class close 的 a 元素的样式(它们是#dialog 的后代),这就是您想要的:对您的关闭文本的唯一控制,而不是您所有的link文字
#dialog a.close {
/*insert css here*/
}
#dialog a.close:hover {
/*insert cool hover css here*/
}