gpt4 book ai didi

html - 使用 CSS 设置相对于另一个对象的边距?

转载 作者:行者123 更新时间:2023-11-28 03:43:40 26 4
gpt4 key购买 nike

我想知道是否可以让 div 的边距定位是相对于另一个对象而不是相对于 View Pane 的边缘。

这是我正在处理的页面: http://www.pikefin.com/phptest/site/main/index3.php

我在 div 周围放置了临时边框以帮助定位。查看文本“我们提供财务数据分析和警报服务。”,我想在文本和 Twitter 小部件之间留出间距。我可以用 &nbsp; 强制定位我想要的位置和 <BR/>但我希望有一个更优雅的边距方法(或者可能完全是其他方式)。

最佳答案

改变

<div id="twittercontrol" style="float:left;margin: 10px 0 0 10px;line-height:1.8;"> 

<div id="twittercontrol" style="float:left;margin: 10px 20px 0 10px;line-height:1.8;">

本质上,您只是将右边距添加到 #twittercontrol 元素。

关于html - 使用 CSS 设置相对于另一个对象的边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8522631/

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