gpt4 book ai didi

jquery - CSS 高度 :100%; a div halfway down the page

转载 作者:太空宇宙 更新时间:2023-11-04 03:50:42 25 4
gpt4 key购买 nike

所以我现在有:

<div>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li id="last"></li>
</ul>
</div>

所有 <li>元素有一个属性 border-right:1px solid black我想要 li#last是一个空的 <li>将一直到页面底部的元素,因此 border-right不会突然停止。

视觉示例:

enter image description here

左边是我目前得到的,右边是我想要实现的。注意最后一个 <li>元素仍然插入 border-right一直到底部。

最佳答案

你可以给<ul>边框而不是 <li>秒。只需将它(和它的 parent )的高度扩展到 100%它延伸到整个页面。

html, body, ul {
height: 100%; /* Full height */
margin: 0; /* No margins to interfere */
}
ul {
list-style-type: none; /* No bullets */
background: #f00; /* A background, to see it */
padding: 0; /* No padding */
display: table; /* Shrinkwrap */
border-right: 1px solid black; /* And the border */
}

http://jsfiddle.net/LfsLv/

关于jquery - CSS 高度 :100%; a div halfway down the page,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23438923/

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