【发布时间】:2021-07-06 00:16:25
【问题描述】:
目标:对齐 Ko-Fi 按钮小部件,使其不会掩盖隐私政策链接,而是整齐地放置在它旁边。如果我能做到这一点,那么我可以为以后添加的页脚栏中的所有其他按钮/链接做到这一点。
我尝试过的:
- 将 Ko-Fi 代码放在自己的 div 中。
- 在容器 div 中嵌套一个带有 Ko-Fi 代码的 div
- 将 Ko-Fi 代码放在容器 div 中。
我目前拥有的/我的代码:
<footer class="border-top footer text-muted">
<div class="container">
© 2020 - APixelADay - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
<script>
kofiWidgetOverlay.draw('knightshade07', {
'type': 'floating-chat',
'floating-chat.donateButton.text': 'Support me',
'floating-chat.donateButton.background-color': '#00b9fe',
'floating-chat.donateButton.text-color': '#fff'
});
</script>
</div>
</footer>
更新:在 dale Landry 的建议下,我确实尝试使用 CSS 移动元素,但没有奏效。现在,我只是想弄清楚如何让元素水平显示而不是垂直显示。
我现在拥有的:
<footer class="border-top footer text-muted">
<div class="container">
© 2020 - APixelADay - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
<p>Test</p>
</div>
</footer>
我在 CSS 文件夹中的页脚 CSS(CSS 是由 Visual Studio 自己制作的,不是我制作的):
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px; /* Vertically center the text there */
}
【问题讨论】:
-
您是否尝试在该页脚上放置任何 CSS?也许是带有 justify-content 的 flex 显示,以查看它是否对 a 标签有任何影响。也许像
.footer{ display: flex; justify-content: space-between; } .footer a { padding-right: 2rem; }之类的东西? -
试过你的建议,没用。
-
你知道如何在你的开发工具中使用检查器吗?打开开发工具,看看您是否可以在元素上放置任何类型的 CSS 以任何方式对其进行操作,值得一试...只需查找您正在使用的任何浏览器;像 firefox 如何使用开发工具
标签: html css button bootstrap-4 widget