gpt4 book ai didi

html - div 将内容与其他 div 对齐

转载 作者:行者123 更新时间:2023-11-28 12:00:57 24 4
gpt4 key购买 nike

在我的网站上,我有以下布局:

outer-div with display: table
inner-div with display: table-row and width/height 100%
list-div with display: table-cell and width 25%
detail-div with display: table-cell and height 75%

在 list-div 中有一个带有一些 li 元素的 ul。在 detail-div 中还有另一个宽度/高度为 100% 的 div。这是它在开始时的样子: http://puu.sh/5e1wo.png

注意列表元素的上边距。当我单击其中一个元素时,我的想法是将其 (html-) 描述添加到 detail-div 元素中。虽然它有效,但奇怪的是它也会影响列表元素的边距,如下图所示:http://puu.sh/5e1HI.png http://puu.sh/5e1Iq.png

不知何故,列表元素似乎与另一个 div 中的内容对齐,即使它们的第一个公共(public) anchor 在上面 3 个级别。有没有办法避免这种情况?

最佳答案

使用 webkit-triads 打开下一个内联元素,然后用你想要的东西交叉检查 View 。它适用于 Chrome 。你有没有 chrome?

关于html - div 将内容与其他 div 对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19887807/

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