@H_404_8@
我试图创建一个列表,在每个列表项的底部有一个边框,但最后一个.我有以下代码:@H_404_8@
@H_404_8@
.menu li { border-bottom: .1rem solID #CCC; padding: 0;}.menu li:last-child { border: none;}.menu li a,.menu li div { display: block; padding: .5rem 0rem .5rem; border-bottom: .1rem solID #ccc}
<div > {% comment %} {% endcomment %} <h1>All {{team.abbrev}} {% trans "Songs" %}</h1> {% for chant in chants %} {% with chant.team as team %} <ul > <li> <span> <h6 > <a href="{% url 'chant' team.slug chant.slug %}">{{ forloop.counter}}) {{ chant.name }}</a> </h6> </span> </li> </ul> {% if forloop.counter == 5 %} {% include 'inc/adsense_Listing.HTML' %} {% endif %} {% enDWith %} {% endfor %}</div>解决方法 如果你有这个CSS
@H_404_8@
@H_404_8@
.menu li { border-bottom: .1rem solID #CCC; padding: 0;}.menu li:last-child { border: none;}.menu li a,.menu li div { display: block; padding: .5rem 0rem .5rem; border-bottom: .1rem solID #ccc}
然后你正在从最后一个li中删除边框.但是,li中的任何链接或div仍将具有底部边框.@H_404_8@
所以你需要删除它:@H_404_8@
@H_404_8@
.menu li:last-child a,.menu li:last child div { border-bottom: none}总结
以上是内存溢出为你收集整理的html – CSS:最后一个孩子没有边框全部内容,希望文章能够帮你解决html – CSS:最后一个孩子没有边框所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)