Html Can';t在css上居中显示文本<;部门>;页脚
我试图在页脚上添加集中文本,但文本始终保持在左侧,即使将边距设置为“自动”和Html Can';t在css上居中显示文本<;部门>;页脚,html,css,Html,Css,我试图在页脚上添加集中文本,但文本始终保持在左侧,即使将边距设置为“自动”和text align:center。 有人能找出遗漏了什么吗 .footer{ 位置:绝对位置; 裕度:100px自动0; 背景色:#393e46; 身高:15%; 最高:360%; 填充:16px 16px 0 16px; 左:0; 右:0; } .超链接{ 颜色:#cdffeb; 位置:相对位置; 文本对齐:居中; 右:0; 左:0; 底部:0; 排名:0; 保证金:自动; 字号:2em; } 试试这个: .f
text align:center
。
有人能找出遗漏了什么吗
.footer{
位置:绝对位置;
裕度:100px自动0;
背景色:#393e46;
身高:15%;
最高:360%;
填充:16px 16px 0 16px;
左:0;
右:0;
}
.超链接{
颜色:#cdffeb;
位置:相对位置;
文本对齐:居中;
右:0;
左:0;
底部:0;
排名:0;
保证金:自动;
字号:2em;
}
试试这个:
.footer{
文本对齐:居中;
背景色:#393e46;
身高:15%;
最高:360%;
填充:16px 16px 0 16px;
左:0;
右:0;
}
.超链接{
颜色:#cdffeb;
位置:相对位置;
文本对齐:居中;
右:0;
左:0;
底部:0;
排名:0;
保证金:自动;
字号:2em;
}
试试这个:
.footer{
文本对齐:居中;
背景色:#393e46;
身高:15%;
最高:360%;
填充:16px 16px 0 16px;
左:0;
右:0;
}
.超链接{
颜色:#cdffeb;
位置:相对位置;
文本对齐:居中;
右:0;
左:0;
底部:0;
排名:0;
保证金:自动;
字号:2em;
}
您希望在页脚div的中心对齐文本。您可以将文本对齐放置在页脚div上您希望在页脚div的中心对齐文本。您可以将文本对齐放置在页脚div上只需将文本对齐:中心
添加到页脚即可修复它,这是一个实时示例只需将文本对齐:居中
添加到页脚即可修复,这是一个实时示例使用显示:flex
如下所示
.footer {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
background-color: #393e46;
height: 15%;
top: 360%;
left: 0;
right: 0;
}
.hyperlink {
color: #cdffeb;
position: relative;
font-size: 2em;
}
像这样使用
display:flex
.footer {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
background-color: #393e46;
height: 15%;
top: 360%;
left: 0;
right: 0;
}
.hyperlink {
color: #cdffeb;
position: relative;
font-size: 2em;
}
考虑使用flex,易于管理且干净。只需将
弹性方向
设置为列
,并将弹性框
中的项目对准中心即可
.footer{
背景颜色:灰色;
填充:15px;
显示器:flex;
弯曲方向:立柱;
对齐项目:居中;
}
.超链接{
颜色:番茄;
字号:2rem;
}
考虑使用易于管理且干净的flex。只需将
弹性方向
设置为列
,并将弹性框
中的项目对准中心即可
.footer{
背景颜色:灰色;
填充:15px;
显示器:flex;
弯曲方向:立柱;
对齐项目:居中;
}
.超链接{
颜色:番茄;
字号:2rem;
}
move text align to the footer move text align to the footer谢谢,我在children类中错误地使用了文本allign。非常感谢。谢谢,我在儿童课上误用了这篇课文。非常感谢。