gpt4 book ai didi

html - div 中的最后一个 child 不工作

转载 作者:行者123 更新时间:2023-11-28 04:52:09 26 4
gpt4 key购买 nike

我使用 addthis 共享插件并将背景颜色更改为黄色,还添加了 bottom-border: of 1px,我想从最后一个 a 中删除底部边框,这对我不起作用使用以下 CSS

CSS

div#at4-share a:last-child
{
border-bottom: 0px solid #1f1f1f;
}

HTML

<div id="at4-share" class="addthis_32x32_style atss atss-left addthis-animated slideInLeft at4-show">
<a class="at4-share-btn at-svc-facebook" href="#">
<span class=" at4-icon aticon-facebook" title="Facebook">Facebook</span>
</a>
<a class="at4-share-btn at-svc-twitter" href="#">
<span class=" at4-icon aticon-twitter" title="Twitter">Twitter</span>
</a>
<a class="at4-share-btn at-svc-pinterest_share" href="#">
<span class=" at4-icon aticon-pinterest_share" title="Pinterest">Pinterest</span>
</a>
<a class="at4-share-btn at-svc-google_plusone_share" href="#">
<span class=" at4-icon aticon-google_plusone_share" title="Google+">Google+</span>
</a>
<a class="at4-share-btn at-svc-compact" href="#">
<span class=" at4-icon aticon-compact" title="More">More</span>
</a>
<div id="at4-scc" class="at-share-close-control ats-transparent at4-show at4-hide-content" title="Hide">
<div class="at4-arrow at-left">Hide</div>
</div>
</div>

我试过了

div#at4-share a:last-of-type
{
border-bottom: 0px solid #1f1f1f;
}

所以我不确定哪里出了问题

最佳答案

您需要使用:last-of-type,因为在这种情况下:last-child 是带有文本隐藏的div

div#at4-share a:last-of-type {border-bottom: 2px solid red;}

https://jsfiddle.net/4y9j0z9q/

也请参阅:last-child

https://jsfiddle.net/4y9j0z9q/1/

关于html - div 中的最后一个 child 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30230613/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com