Reputation: 547
Could anyone inform me as to why this text is not centered? I swear the upload and download buttons are identical, also the subscribe kinda does the same thing..is the iphone just weird and I have to compensate for the non conformity? Thanks
Sorry for posting the wall of text, I would know how else one would be able to decipher this problem.
<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);
}
Upvotes: 3
Views: 2225
Reputation: 404
Post is 2 years old now, but anyway:
padding
can not be set to auto
— it is not valid CSS — so the buttons probably have padding set elsewhere or are using the browser's default padding.
I would guess the padding is pushing the "Download" text to the right and the button is not wide enough to accommodate the padding and the text.
You could set padding-left: 0; padding-right: 0
instead.
I can't exactly tell without seeing the dev tools so this is a best guess.
Upvotes: 2