作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
请看这张图片,它会解释得更好 https://gyazo.com/333fc2ef04f558480386b7be67eb1bda
我的网页底部有一个橙色的页脚,我希望文本在页脚栏内的同一行上“左”、“中”和“右”对齐。
现在文本已对齐,但文本 3 对齐位于彼此下方的 3 行。
这是我的 HTML:
<div class="row">
<div id="footer">
<div align="left"><h3>Contact</h3></div>
<div align="center"><h3>Computerbasen</h3></div>
<div align="right"><h3>Info</h3></div>
</div>
</div>
这是我的 CSS:
#footer {
background-color: #FF7633;
width: 100%;
height: 50px;
border-radius: 5px;
padding-top: 10px;
position: absolute;
bottom: 0;
}
最佳答案
我推荐flexbox对于这种类型的布局。
删除 align
属性并将其添加到您的 #footer
。
#footer {
display: flex;
justify-content: space-between;
}
关于html - 将页脚上的文本对齐在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43563903/
我是一名优秀的程序员,十分优秀!