我有一些代码,我想在链接中的父跨度上应用边框,但我的 css 在两个跨度上都应用了 css 样式?
<div id="DownloadButton">
<a href="DownloadMovie.php/?FileName=Assignment 1- Regular Expression (2).docx&MovieID=2179136">
<span>
<span class="glyphicon glyphicon-download-alt" aria-hidden="true" style="float:left;">
</span>
Assignment 1- Regular Expression (2).docx
</span>
</a>
</div>
我的CSS代码
#DownloadButton a span{
font-size: 13px;
display:inline-block;
font-weight: bold;
width:auto;
padding:0px 10px 0px 0px;
border-radius: 05px 5px 05px 05px;
border:1px solid red;
}
最佳答案
用子选择器指定:
#DownloadButton a > span {
关于html - 跨度上的样式也适用于其子跨度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29151635/