[英]Aligning form to bottom center horizontally
I have a mailchimp form that I'd like to align to center at the bottom of a page (with a 10px padding from the bottom). 我有一个mailchimp表单,我想对齐到页面底部的中心(底部填充10像素)。
I managed to get it to the bottom, but I don't see how I can move to the center. 我设法将其放到最底端,但是我看不到如何移动到中央。
.mc-field-group{
background-color: #174365;
opacity:0.8;
padding: 0px;
color: #fff;
font-family: Helvetica, Arial;
width:400px;
font-size:12px;
padding-left:10px;
position: absolute; bottom: 0; left: 0;
}
#mce-EMAIL {
float: left;
margin:10px;
font-size:12px;
background: transparent;
}
#mce-FNAME{
margin:10px;
font-size:12px;
background: transparent;
}
#mc_embed_signup input {border:1px solid #fff; -webkit-appearance:none; color:#fff; text-transform: uppercase; background: transparent; text-indent:2%; color}
#mc_embed_signup .button {clear:both; background-color: #174365; color: #FFFFFF; display: inline-block; font-size:14px; margin: 11px 5px 5px 0; text-align: center; text-decoration: uppercase; width: auto; border:1px solid #fff; font-size:12px;}
Anyone know how I could get it to stick to the bottom of the page (with a little padding)? 任何人都知道如何使它粘在页面底部(稍加填充)?
Thanks! 谢谢! :) :)
Add right:0;
right:0;
添加right:0;
, margin-left:auto;
, margin-left:auto;
and margin-right:auto;
和margin-right:auto;
to .mc-field-group
到.mc-field-group
Change to this: 更改为此:
.mc-field-group {
background-color: #174365;
opacity:0.8;
padding: 0px;
color: #fff;
font-family: Helvetica, Arial;
width:400px;
font-size:12px;
position:absolute;
left:0;
right:0;
bottom:0;
margin-left:auto;
margin-right:auto;
}
PS: PS:
Use text-align:center;
使用text-align:center;
to center the content inside the div
. 将内容放在div
内部。
Also, margin-left
and margin-right
property can be replaced with: margin: 0 auto;
同样, margin-left
和margin-right
属性可以替换为: margin: 0 auto;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.