有人可以告诉我为什么这个文字没有居中?我发誓上传和下载按钮是相同的,订阅有点做同样的事情.. iphone只是奇怪,我必须弥补不符合?感谢
很抱歉发布文字墙,我知道怎么能解读这个问题。
<html>
<head>
<title>Community Sound</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="mobile_style.css">
</head>
<body>
<!-- Headers -->
<div class="container">
<div class="no-result vertical-align-outer">
<div class="vertical-align">
<h1 class="header">Sample pack Generator</h1>
<p class="subheader">Having a creative block?</p>
</div>
</div>
</div>
<div class=" vertical-align-outer">
<div class="vertical-align">
<div class='center margin_bottom'>
<button class='text-white button'>Upload</button>
<button class='text-white button'>Download</button>
</div>
</div>
</div>
<div class="no-result vertical-align-outer">
<div class="vertical-align">
<form action="phEmail.php" method="POST">
<!-- EMAIL -->
<div>
<label for="email"></label>
<input type="email" class="email glowing-border" name="email" placeholder="Enter your email">
</div>
<button type="submit" class="emailbtn">Subscribe</button>
<span></span>
<!-- errors will go here -->
<br>
<br>
<div id="sub_result">
</div>
</div>
</div>
<footer>
<p>
<a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=5NenPKc4q2177ZpoquvHh8okRxZWSeSNw4aedlweOg4OZeMMN3bW78JCXEO&dispatch=5885d80a13c0db1f8e263663d3faee8d64ad11bbf4d2a5a1a0d303a50933f9b2" target="_blank" STYLE="text-decoration:none; color: #ffc439;"
class="text-white"> Donate</a> |
<a href="about.html" STYLE="text-decoration:none" class="text-white">About</a> |
<a href="terms.html" STYLE="text-decoration:none" class="text-white">Terms</a> |
<a href="contact.html" target="_blank" STYLE="text-decoration:none" class="text-white"> Contact</a>
</p>
</footer>
</body>
</html>
CSS
@import url(http://netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css);
body {
background: url(http://i.imgur.com/hyC6F3D.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
margin: 0 auto;
width: 100%;
padding: 0px;
font-family: "gill sans";
color: #ffffff;
font-weight: 300;
}
.header {
font-size: 30px;
color: #ffffff;
font-style: normal;
font-variant: normal;
font-weight: 100;
}
.subheader {
font-size: 15px;
color: #ffffff;
font-style: normal;
font-variant: normal;
font-weight: 100;
}
.container {
width: 100%;
height: 100px;
margin-top:5%;
}
.no-result {
text-align: center;
background-color: rgba(0, 0, 0, 0.0);
color: #fff;
}
.vertical-align-outer {
display: table;
width: 100%;
}
.vertical-align {
display: table-cell;
vertical-align: middle;
}
footer {
width:100%;
height:50px;
position:fixed;
bottom:0;
left:0;
text-align:center;
}
.text-white {
font-family: "gill sans";
color: white;
font-style: normal;
font-variant: normal;
font-weight: 100;
}
.button{
color:white;
height:100px;
width:100px;
margin:5%;
background-color: rgba(0, 0, 0, 0.4);
border-color:rgba(255,255, 255, 1);
border: 2px solid #fff;
font-size: 20px;
outline: 0;
-webkit-transition: 100ms linear 0s;
-moz-transition: 100ms linear 0s;
-o-transition: 100ms linear 0s;
transition: 100ms linear 0s;
text-align: center;
padding-left: auto;
padding-right: auto;
}
.button:active {
background-color: rgba(255, 255, 255, .50);
-webkit-transform: scale(1.2);
}
.button:target {
background-color: rgba(255, 255, 255, .20);
-webkit-transform: scale(100%);
}
.center{
text-align: center;
}
.margin_bottom{
margin:20px;
}
.email {
height: 30px;
width: 70%;
font-size: 20px;
font-style: normal;
font-variant: normal;
font-weight: 100;
line-height: 30px;
color: #cacaca;
background-color: rgba(255, 255, 255, 0);
margin:2%;
}
.glowing-border {
border: 2px solid #dadada;
border-radius: 7px;
}
.glowing-border:focus {
background-color: rgba(255, 255, 255, .8);
color: black;
outline: none;
border-color: #ffffff;
box-shadow: 0 0 100px #ffffff;
}
.emailbtn {
height: 35px;
width: 120px;
font-size: 20px;
font-style: normal;
font-variant: normal;
font-weight: 100;
margin: 5%;
color: #cacaca;
background-color: rgba(255, 255, 255, 0);
border: 2px solid #dadada;
border-radius: 7px;
outline: 0;
text-align: center;
padding-left: auto;
padding-right: auto;
}
.emailbtn:active {
background-color: rgba(255, 255, 255, .50);
-webkit-transform: scale(1.2);
border-color: #ffffff;
box-shadow: 0 0 30px #ffffff;
}
.emailbtn:target {
background-color: rgba(255, 255, 255, .20);
-webkit-transform: scale(1.2);
}
答案 0 :(得分:0)
帖子现在2岁了,但是无论如何:
padding
不能设置为auto
(这不是有效的CSS),因此可能按钮在其他位置设置了填充或正在使用浏览器的默认填充。 >
我想填充物会将“下载”文本推到右侧,并且按钮的宽度不足以容纳填充物和文本。
您可以改为设置padding-left: 0; padding-right: 0
。
我不知道开发工具就无法准确判断,所以这是最好的猜测。