gpt4 book ai didi

javascript - Twitter Bootstrap - 如何在工具提示弹出窗口和元素之间添加更多边距

转载 作者:可可西里 更新时间:2023-11-01 02:02:09 25 4
gpt4 key购买 nike

我没有尝试任何东西,因为我无法理解工具提示和元素之间的空间是从 Bootstrap 创建/添加的,通常工具提示真的靠近触发工具提示事件的元素。

我只是想让工具提示的开口距离元素稍微远一点,我的意思是从工具提示和元素中添加更多的边距。

如果可能的话,我想了解如何在 css 中执行此操作,以及是否可以同时为右、左、上、下工具提示制作它。

希望问题很清楚。

这是工具提示在我的应用中的样子:

enter image description here

这就是我想做的以及之后的样子:

enter image description here

最佳答案

这是顶部工具提示的默认 CSS:

.tooltip.top {
padding: 5px 0;
margin-top: -3px;
}

您可以在自己的 CSS 中覆盖它:

.tooltip.top {
margin-top: -10px;
}

请注意,此代码仅适用于顶部的工具提示,您需要调整 CSS 以适应其他 3 个方向:

.tooltip.top    { margin-top: -10px; }
.tooltip.right { margin-left: 10px; }
.tooltip.bottom { margin-top: 10px; }
.tooltip.left { margin-left: -10px; }

关于javascript - Twitter Bootstrap - 如何在工具提示弹出窗口和元素之间添加更多边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15601451/

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