gpt4 book ai didi

css - 为什么会有不必要的填充?

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

<div style="background-color: #EEEEEE; display: inline-table;">
<div style="display: inline-table; width: 100%">
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame00.gif"></div>
<div style="display: table-cell; height: 5px; background-image: url('/design/_messages/frameUP.gif');"></div>
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame01.gif"></div>
</div>
<div style="display: inline-table; width: 100%">
<div style="display: table-cell; width: 5px; background-image: url('/design/_messages/frameLEFT.gif');"></div>
<div style="display: table-cell; margin: 0; padding: 0; border: none">sdfkl sdklf jklfff ffff fff fff fffffsjdf klsfffff fff fjdf</div>
<div style="display: table-cell; text-align: right; width: 5px; background-image: url('/design/_messages/frameRIGHT.gif');"></div>
</div>
<div style="display: inline-table; width: 100%">
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame10.gif"></div>
<div style="display: table-cell; height: 5px; background-image: url('/design/_messages/frameDOWN.gif');"></div>
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame11.gif"></div>
</div>

https://jsfiddle.net/Lsroqeyg/

右边有一个不必要的间距。右边太远了。看图: enter image description here

最佳答案

如下图将父元素的显示改为inline-grid

<div style="background-color: #EEEEEE; display: inline-grid;"> <!--inline-grid here-->
<div style="display: inline-table; width: 100%">
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame00.gif"></div>
<div style="display: table-cell; height: 5px; background-image: url('/design/_messages/frameUP.gif');"></div>
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame01.gif"></div>
</div>
<div style="display: inline-table; width: 100%">
<div style="display: table-cell; width: 5px; background-image: url('/design/_messages/frameLEFT.gif');"></div>
<div style="display: table-cell; margin: 0; padding: 0; border: none">sdfkl sdklf jklfff ffff fff fff fffffsjdf klsfffff fff fjdf</div>
<div style="display: table-cell; text-align: right; width: 5px; background-image: url('/design/_messages/frameRIGHT.gif');"></div>
</div>
<div style="display: inline-table; width: 100%">
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame10.gif"></div>
<div style="display: table-cell; height: 5px; background-image: url('/design/_messages/frameDOWN.gif');"></div>
<div style="display: table-cell; width: 5px; height: 5px;"><img src="/design/_messages/frame11.gif"></div>
</div>

关于css - 为什么会有不必要的填充?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48432409/

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