gpt4 book ai didi

html - 在页脚底部向右浮动和元素

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

我在将一些社交图标添加到我正在制作的 wordpress 主题的页脚时遇到问题。问题是我无法让图标 float 在页脚的右下角。

这是我想要实现的目标:灰色元素是存在的,红色元素是社交图标条,我想将其添加到其中。

enter image description here

我能做到这一点的唯一方法是像这样手动添加一个全宽的边距:

.social-icons {
padding: 0!important;
margin-left:864px;
list-style-type: none!important;
position:absolute;
bottom:0;

}

问题在于,当调整窗口大小时,社交图标到处都是。我知道 float right 会很好用,但问题是它不会。

如果我尝试这样做:

.social-icons {
padding: 0!important;
list-style-type: none!important;
position:absolute;
bottom:0;
float:right;
}

结果是这样的:

enter image description here

标题为logo的元素已经使用了float:right;所以这可能与它有关。这是 Logo div:

.footerlogo img {

float: right;

}

问题是如果我采用 float:right;关闭 Logo div 并保持 float :正确;在社交图标条上,社交图标条现在将位于 Logo 位置, Logo 向后移动。因此:

enter image description here

任何人都可以指导我将社交图标(图像中的红色元素)粘贴到右下角的方向,让我知道如何实现这一点,因为使用 float right 的正常方式不允许它 float 到右下角,仅到 Logo 位置。

最佳答案

尝试将 right 属性设置为 0,这应该使元素与最近定位的父元素的右边缘对齐:

.social-icons {
padding: 0!important;
list-style-type: none!important;
position:absolute;
bottom:0;
right: 0;
}

关于html - 在页脚底部向右浮动和元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19287333/

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