gpt4 book ai didi

html - 文本位于左侧且文本居中的页脚

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

我正在尝试创建一个页脚,文本在左侧,文本在中心(相对于窗口的宽度)。

现在,我有一个页脚,其中包含两个宽度为 50% 且文本左对齐的 div。不幸的是,第二个 div 中的文本相对于整个页脚没有完全居中。

解决方案可能很明显,但我似乎找不到。

最佳答案

这应该可以解决问题:

<div id="footer">
<span class="left">
Left
</span>
Center
</div>

<style>
#footer {
width:100%;
text-align:center;
}
.left {
float:left;
}
</style>

参见 fiddle :http://jsfiddle.net/y8g3j7qx/

关于html - 文本位于左侧且文本居中的页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26274613/

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