I am trying to fix the design error that I am facing with my log in page.
I have been trying to center the username and password form input field but it doesn't work. The icon is also misaligned with the username and password field.
I have tried altering the CSS but it just wouldn't center.
Below are my HTML and CSS codes:
body {
margin: 0;
padding: 0;
font-family: 'Corbel', sans-serif;
color: #FFFFFF
}
/*CSS for login.html & signup.html*/
#login-container {
background-color: #FFFFFF;
position: relative;
top: 15%;
margin: auto;
width: 340px;
height: 445px;
text-align: center;
}
#login-container-title {
position: relative;
background-color: #FFAE42;
width: 100%;
padding: 20px 0px;
font-size: 22px;
font-weight: bold;
}
#register-container {
background-color: #FFFFFF;
position: relative;
top: 15%;
margin: auto;
width: 340px;
height: 500px;
text-align: center;
}
#register-container-title {
position: relative;
background-color: #FFAE42;
width: 100%;
padding: 20px 0px;
font-size: 22px;
font-weight: bold;
}
.register {
margin: auto;
padding: 16px 0;
text-align: center;
margin-top: 30px;
width: 85%;
border-top: 1px solid #696969;
}
#register-link {
margin-top: 15px;
padding: 15px 35px;
background: #FFAE42;
color: #FFFFFF;
font-size: 15;
font-weight: bold;
border: 0 none;
cursor: pointer;
border-radius: 3px;
}
#register-required {
margin: auto;
width: 260px;
background-color: #ededed;
padding: 8px 0px;
color: black;
margin-top: 25px;
}
}
.input {
margin: auto;
width: 260px;
background-color: #ededed;
padding: 8px 0px;
margin-top: 25px;
}
.input-addon {
position: relative;
top: -2px;
float: left;
background-color: #ededed;
border: 1px solid #ededed;
padding: 4px 8px;
color: #757575;
border-right: 1px solid #757575;
}
input[type=checkbox] {
cursor: pointer;
}
input[type=text] {
color: #696969;
margin: 0;
background-color: #ededed;
font-size: 15;
border: 1px solid #ededed;
padding: 6px 0px;
}
input[type=password] {
color: #696969;
margin: 0;
background-color: #ededed;
font-size: 15;
border: 1px solid #ededed;
padding: 6px 0px;
}
/*to remove blue block while in focus */
*:focus {
outline: none;
}
input[type=submit] {
padding: 15px 35px;
background: #FFAE42;
color: #FFFFFF;
font-size: 15;
font-weight: bold;
border: 0 none;
cursor: pointer;
margin-top: 35px;
}
/*CSS for main.html*/
.sidebar {
margin: auto;
padding: 0px;
width: 200px;
background-color: #FFFFFF;
position: fixed;
height: 100%;
overflow: auto;
}
.sidebar a {
display: block;
color: black;
padding: 16px;
text-decoration: none;
}
.sidebar a.active {
background-color: #FFAE42;
color: white;
}
.sidebar a:hover:not(.active) {
background-color: #555;
color: white;
}
.content {
margin-left: 250px;
padding: 30px 16px;
height: 100%;
}
#media screen and (max-width: 700px) {
.sidebar {
width: 100%;
height: auto;
position: relative;
}
.sidebar a {
float: left;
}
div.content {
margin-left: 0;
}
}
#media screen and (max-width: 400px) {
.sidebar a {
text-align: center;
float: none;
}
}
/* Alert message box */
/* The alert message box */
.alert {
padding: 5px;
background-color: green;
color: white;
margin-bottom: 15px;
}
<html>
<head>
<meta charset="UTF-8">
<title>Phisherman - Login</title>
<meta name="description" content="Phisherman - Login/Register">
<!--Meta name=viewport for mobile phone scaling-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
body {
background-image: url('backgroundimg.png');
}
</style>
</head>
<body>
<div id="login-container">
<div id="login-container-title">
Login
</div>
<form method ="POST" action="auth.php">
<div class="input">
<div class="input-addon">
<i class="material-icons">face</i>
</div>
<input id="username" name="username" placeholder="Username" type="text" required class="validate" autocomplete="off">
</div>
<div class="input">
<div class="input-addon">
<i class="material-icons">vpn_key</i>
</div>
<input id="password" name="password" placeholder="Password" type="password" required class="validate" autocomplete="off">
</div>
<input type="submit" name="submit" value="Log In" />
</form>
<div class="register">
<span style="color: #657575">Don't have an account yet?</span>
<button id="register-link">Register here</button>
</div>
</div>
</div>
</body>
</html>
Use flexbox
body {
margin: 0;
padding: 0;
font-family: 'Corbel', sans-serif;
color: #FFFFFF
}
/*CSS for login.html & signup.html*/
#login-container {
background-color: #FFFFFF;
position: relative;
top: 15%;
margin: auto;
width: 340px;
height: 445px;
text-align: center;
}
#login-container form {
display: flex;
flex-flow: column wrap;
}
#login-container-title {
position: relative;
background-color: #FFAE42;
width: 100%;
padding: 20px 0px;
font-size: 22px;
font-weight: bold;
}
#register-container {
background-color: #FFFFFF;
position: relative;
top: 15%;
margin: auto;
width: 340px;
height: 500px;
text-align: center;
}
#register-container-title {
position: relative;
background-color: #FFAE42;
width: 100%;
padding: 20px 0px;
font-size: 22px;
font-weight: bold;
}
.register {
margin: auto;
padding: 16px 0;
text-align: center;
margin-top: 30px;
width: 85%;
border-top: 1px solid #696969;
}
#register-link {
margin-top: 15px;
padding: 15px 35px;
background: #FFAE42;
color: #FFFFFF;
font-size: 15;
font-weight: bold;
border: 0 none;
cursor: pointer;
border-radius: 3px;
}
#register-required {
margin: auto;
width: 260px;
background-color: #ededed;
padding: 8px 0px;
color: black;
margin-top: 25px;
}
.input {
display: flex;
justify-content: center;
background-color: #ededed;
padding: 8px 0px;
margin: 25px auto 0;
width: 100%;
}
.input-addon {
position: relative;
top: 0;
float: left;
background-color: #ededed;
border: 1px solid #ededed;
padding: 6px 10px;
color: #757575;
border-right: 1px solid #757575;
margin-right: auto;
}
input[type=checkbox] {
cursor: pointer;
}
input[type=text] {
color: #696969;
margin: 0;
background-color: #ededed;
font-size: 15px;
border: 1px solid #ededed;
padding: 10px;
width: 100%;
}
input[type=password] {
color: #696969;
margin: 0;
background-color: #ededed;
font-size: 15px;
border: 1px solid #ededed;
padding: 10px;
width: 100%;
}
/*to remove blue block while in focus */
*:focus {
outline: none;
}
input[type=submit] {
padding: 15px 35px;
background: #FFAE42;
color: #FFFFFF;
font-size: 15;
font-weight: bold;
border: 0 none;
cursor: pointer;
margin-top: 35px;
}
/*CSS for main.html*/
.sidebar {
margin: auto;
padding: 0px;
width: 200px;
background-color: #FFFFFF;
position: fixed;
height: 100%;
overflow: auto;
}
.sidebar a {
display: block;
color: black;
padding: 16px;
text-decoration: none;
}
.sidebar a.active {
background-color: #FFAE42;
color: white;
}
.sidebar a:hover:not(.active) {
background-color: #555;
color: white;
}
.content {
margin-left: 250px;
padding: 30px 16px;
height: 100%;
}
#media screen and (max-width: 700px) {
.sidebar {
width: 100%;
height: auto;
position: relative;
}
.sidebar a {
float: left;
}
div.content {
margin-left: 0;
}
}
#media screen and (max-width: 400px) {
.sidebar a {
text-align: center;
float: none;
}
}
/* Alert message box */
/* The alert message box */
.alert {
padding: 5px;
background-color: green;
color: white;
margin-bottom: 15px;
}
<html>
<head>
<meta charset="UTF-8">
<title>Phisherman - Login</title>
<meta name="description" content="Phisherman - Login/Register">
<!--Meta name=viewport for mobile phone scaling-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="main.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
body {
background-image: url('backgroundimg.png');
}
</style>
</head>
<body>
<div id="login-container">
<div id="login-container-title">
Login
</div>
<form method="POST" action="auth.php">
<div class="input">
<div class="input-addon">
<i class="material-icons">face</i>
</div>
<input id="username" name="username" placeholder="Username" type="text" required class="validate" autocomplete="off">
</div>
<div class="input">
<div class="input-addon">
<i class="material-icons">vpn_key</i>
</div>
<input id="password" name="password" placeholder="Password" type="password" required class="validate" autocomplete="off">
</div>
<input type="submit" name="submit" value="Log In" />
</form>
<div class="register">
<span style="color: #657575">Don't have an account yet?</span>
<button id="register-link">Register here</button>
</div>
</div>
</div>
</body>
</html>
I want to move to the text area to align with other fields and then move all these fields to the down of the text "Feel free...." I was trying to use marigin-left, marigin-top, but nothing works. All the time these fields stay in one place. Do not know why.
It has to work on ip 6/7/8 plus resolution.
Could you tell me how can I achieve it?
* {
margin: 0;
padding: 0;
}
header {
width: 1920;
height: 1080px;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
height: 1080px;
background-image: linear-gradient(180deg, #EFEFEF00 0%, #0F4A37 100%);
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
}
footer img {
margin-top: 5px;
height: 30px;
display: inline-block;
padding: 0px 10px 0px 0px;
}
.main-nav {
float: right;
color: #000000;
margin-top: 40px;
margin-right: 0px;
}
.main-nav li {
display: inline-block;
}
.main-nav li a {
color: #000000;
text-decoration: none;
font: Bold 25px/15px Arial;
padding: 5px;
}
#logo {
margin-top: 10px;
float: left;
}
#tekst {
position: absolute;
}
#sign a {
background-color: #DCDFDE;
padding: 30px 15px 17px 15px;
border-top: 3px solid black;
border-bottom: 3px solid black;
border-left: 3px solid black;
border-right: 3px solid black;
}
#profilesign {
margin-top: 400px;
margin-left: 250px;
font: Bold 40px/40px Georgia;
letter-spacing: 0;
color: black;
}
.left {
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 150px 150px;
}
img.left {
padding: 0px 40px 20px 40px;
width: 250px;
height: 250px;
margin-left: 400px;
margin-top: 500px;
}
article input {
width: 300px;
height: 40px;
background: white;
border-radius: 4px;
text-decoration: none;
text-align: center;
font: Bold 25px/12px Arial;
border-radius: 120;
border-style: none;
padding: 6px;
margin-left: 1000px;
margin-top: 500px;
}
article #textSign {
font-size: 50px;
color: black;
text-align: center;
}
#centerText {
text-align: center;
}
#something {
width: 700px;
height: 300px;
text-align: justify;
margin-left: 1000px;
font-size: 30px;
font-weight: bold;
}
#media only screen and (max-device-width: 500px) {
#profilesign {
width: 1000px;
margin-top: 750px;
margin-left: 400px;
font: Bold 60px/40px Georgia;
letter-spacing: 0;
color: black;
}
img.left {
padding: 0px 40px 20px 40px;
width: 550px;
height: 550px;
margin-left: 550px;
margin-top: 450px;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 60px;
background-color: black;
color: white;
text-align: center;
}
footer img {
margin-top: 5px;
height: 50px;
display: inline-block;
padding: 0px 10px 0px 0px;
}
#sign a {
background-color: #DCDFDE;
padding: 20px 15px 17px 1px;
border-top: 3px solid black;
border-bottom: 3px solid black;
border-left: 3px solid black;
border-right: 3px solid black;
}
#logo img {
margin-left: 550px;
text-align: center;
width: 650px;
}
body {
background-image: linear-gradient(180deg, #EFEFEF00 0%, #0F4A37 100%);
background-size: 100% 3000px;
width: auto;
}
.row {
width: 2500px;
display: grid;
grid-template-columns: 0% 80%;
}
.main-nav {
margin-left: 100px;
margin-top: 250px;
float: left;
display: inline-flex;
list-style: none;
}
.main-nav li a {
border-right: 3px solid black;
color: #000000;
text-decoration: none;
font: Bold 58px/45px Arial;
}
#something {
width: 700px;
height: 300px;
text-align: justify;
margin-top: 200px;
font-size: 30px;
font-weight: bold;
}
article input {
width: 400px;
height: 70px;
background: white;
border-radius: 4px;
text-decoration: none;
text-align: center;
font: Bold 45px/12px Arial;
border-radius: 120;
border-style: none;
padding: 6px;
margin-left: 700px;
}
}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>DingDog</title>
<link rel="stylesheet" href="css-images/style-contact.css">
</head>
<body>
<header>
<div class="row">
<ul id="logo"> <img src="css-images/dingdog-logo.png"> </ul>
<ul class="main-nav">
<li style="padding-left:10px">PROFILE</li>
<li style="padding-left:10px">MAP</li>
<li style="padding-left:10px">YOUR FRIENDS</li>
<li style="padding-left:10px">MAILBOX</li>
<li style="padding-left:10px" id="sign">LOG OUT</li>
</ul>
</div>
<section>
<article>
<p id="profilesign">Feel free to send us a question.</p>
<img class="left" src="css-images/mial.jpg" style='position:absolute;left:0px; top:0px;' />
<div id="lala">
<p id="centerText">
<label><input type="email" name="email" placeholder="Email" style='margin-top:250px;position:absolute;left:0px; top:0px;' ></label><br/>
<label><input type="name" name="name" placeholder="Name" style="margin-top: 350px; position:absolute;left:0px; top:0px;"></label><br>
<label><input type="subject" name="subject" placeholder='Subject:' style="margin-top: 450px; position:absolute;left:0px; top:0px;"></label><br></p>
<textarea placeholder='Type something' id="something" style="margin-top: 550px; position:absolute;left:0px; top:0px;"></textarea>
</div>
<label id="submit"><input type="submit" name="send" value="Send" style="margin-top: 900px;position:absolute;left:0px; top:0px; background: #2699FB 0% 0% no-repeat padding-box;"></label>
</article>
</section>
</header>
<footer>
<img src="social/instagram.png" />
<img src="social/twitter-white-logo.png" />
<img src="social/facebook.png" />
</footer>
</body>
</html>
My login page looks and acts how I want it to when my container div is set to display: block and position: static. However, when it becomes either display: inline-block or position: absolute, it stops taking up its max width of 500px. I want to use absolute positioning to center my div vertically and horizontally, so I need the layout to stay the same as it looks when it has static position. How can I achieve this?
* {
-moz-box-sizing: border-box !important;
-webkit-box-sizing: border-box !important;
box-sizing: border-box !important;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#login-box {
max-width: 500px;
min-width: 300px;
box-shadow: #bbb 0 0 20px 0;
display: block;
position: static;
/*position: absolute;*/
}
#HeaderForLoginForm {
background-image: url('https://dummyimage.com/600x106/333333/fff.png&text=SOME+LOGO');
background-repeat: no-repeat;
background-size: 200px;
background-position-x: center;
background-position-y: 25px;
background-color: #000;
height: 110px;
text-align: center;
line-height: 56px;
}
#headerlinks {
color: rgb(90, 90, 90);
font-weight: bold;
font-size: 12px;
margin-top: 54px;
display: inline-block;
}
#media (min-width: 450px) {
#HeaderForLoginForm {
background-position-x: 25px;
background-position-y: center;
text-align: right;
height: 95px;
line-height: 95px;
}
#headerlinks {
margin-right: 20px;
margin-top: 0;
}
}
#DivForLoginForm {
background: #b7d9ff;
background: -webkit-linear-gradient(#b7d9ff, #fff);
background: -o-linear-gradient(#b7d9ff, #fff);
background: -moz-linear-gradient(#b7d9ff, #fff);
background: linear-gradient(#b7d9ff, #fff);
text-align: center;
}
#LoginForm {
display: inline-block;
width: 74%;
margin-top: 20px;
margin-bottom: 40px;
}
#LoginForm input.textField {
display: inline-block;
width: 100%;
padding: 10px;
margin-top: 18px;
font-size: 14px;
border-radius: 3px;
border: 1px solid #999;
}
#terms-wrapper {
margin-top: 16px;
margin-bottom: 30px;
text-align: left;
font-size: 14px;
font-weight: bold;
}
#terms-wrapper input {
margin-left: 0;
vertical-align: -2px;
}
a[href] {
color: #0079dd;
text-decoration: none;
}
a[href]:hover {
text-decoration: underline;
}
input#btn-login {
padding: 14px;
height: auto;
width: 40%;
min-width: 100px;
float: right;
background-color: #1064d8;
color: #fff;
font-weight: bold;
font-size: 16px;
outline: none !important;
border: none;
border-radius: 3px;
cursor: pointer;
}
input#btn-login:hover {
background-color: #004BBF;
}
input#btn-login:active {
background-color: #0031A5;
}
#loginfooter {
background-image: url("http://images.naldzgraphics.net/2014/08/20-brushed-seamless-texture.jpg");
color: rgb(100, 100, 100);
padding: 12px;
font-size: 11px;
}
[data-val-required] {
background-color: #fff;
}
<section id="login-box-wrapper">
<div id="login-box">
<header id="HeaderForLoginForm">
<div id="headerlinks">
some link |
some other link
</div>
</header>
<div id="DivForLoginForm">
<form method="post" id="LoginForm">
<input class="textField" id="UserName" name="UserName" placeholder="Username" type="text">
<input class="textField" id="Password" name="Password" placeholder="Password" type="password">
<div id="terms-wrapper">
<input id="HasAcceptedTermsConditions" name="HasAcceptedTermsConditions" type="checkbox">
<label for="HasAcceptedTermsConditions">
I agree to the <a id="terms-link" href="#" target="_blank">General Terms of Service</a>
</label>
</div>
<input id="btn-login" type="submit" value="LOG IN">
</form>
</div>
<footer id="loginfooter" style="text-align: center;">
<span>© 2009-2017 Some Company, LLC — All rights reserved</span>
</footer>
</div>
</section>
Add width: 100%; to #login-box to get it to take up the max-width rule.
Use position: absolute; with top, left and transform with the translate function to horizontally and vertically center the login box.
#login-box {
width: 100%;
max-width: 500px;
min-width: 300px;
box-shadow: #bbb 0 0 20px 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate( -50%, -50% );
}
* {
-moz-box-sizing: border-box !important;
-webkit-box-sizing: border-box !important;
box-sizing: border-box !important;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#login-box {
width: 100%;
max-width: 500px;
min-width: 300px;
box-shadow: #bbb 0 0 20px 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate( -50%, -50% );
}
#HeaderForLoginForm {
background-image: url('https://dummyimage.com/600x106/333333/fff.png&text=SOME+LOGO');
background-repeat: no-repeat;
background-size: 200px;
background-position-x: center;
background-position-y: 25px;
background-color: #000;
height: 110px;
text-align: center;
line-height: 56px;
}
#headerlinks {
color: rgb(90, 90, 90);
font-weight: bold;
font-size: 12px;
margin-top: 54px;
display: inline-block;
}
#media (min-width: 450px) {
#HeaderForLoginForm {
background-position-x: 25px;
background-position-y: center;
text-align: right;
height: 95px;
line-height: 95px;
}
#headerlinks {
margin-right: 20px;
margin-top: 0;
}
}
#DivForLoginForm {
background: #b7d9ff;
background: -webkit-linear-gradient(#b7d9ff, #fff);
background: -o-linear-gradient(#b7d9ff, #fff);
background: -moz-linear-gradient(#b7d9ff, #fff);
background: linear-gradient(#b7d9ff, #fff);
text-align: center;
}
#LoginForm {
display: inline-block;
width: 74%;
margin-top: 20px;
margin-bottom: 40px;
}
#LoginForm input.textField {
display: inline-block;
width: 100%;
padding: 10px;
margin-top: 18px;
font-size: 14px;
border-radius: 3px;
border: 1px solid #999;
}
#terms-wrapper {
margin-top: 16px;
margin-bottom: 30px;
text-align: left;
font-size: 14px;
font-weight: bold;
}
#terms-wrapper input {
margin-left: 0;
vertical-align: -2px;
}
a[href] {
color: #0079dd;
text-decoration: none;
}
a[href]:hover {
text-decoration: underline;
}
input#btn-login {
padding: 14px;
height: auto;
width: 40%;
min-width: 100px;
float: right;
background-color: #1064d8;
color: #fff;
font-weight: bold;
font-size: 16px;
outline: none !important;
border: none;
border-radius: 3px;
cursor: pointer;
}
input#btn-login:hover {
background-color: #004BBF;
}
input#btn-login:active {
background-color: #0031A5;
}
#loginfooter {
background-image: url("http://images.naldzgraphics.net/2014/08/20-brushed-seamless-texture.jpg");
color: rgb(100, 100, 100);
padding: 12px;
font-size: 11px;
}
[data-val-required] {
background-color: #fff;
}
<section id="login-box-wrapper">
<div id="login-box">
<header id="HeaderForLoginForm">
<div id="headerlinks">
some link |
some other link
</div>
</header>
<div id="DivForLoginForm">
<form method="post" id="LoginForm">
<input class="textField" id="UserName" name="UserName" placeholder="Username" type="text">
<input class="textField" id="Password" name="Password" placeholder="Password" type="password">
<div id="terms-wrapper">
<input id="HasAcceptedTermsConditions" name="HasAcceptedTermsConditions" type="checkbox">
<label for="HasAcceptedTermsConditions">
I agree to the <a id="terms-link" href="#" target="_blank">General Terms of Service</a>
</label>
</div>
<input id="btn-login" type="submit" value="LOG IN">
</form>
</div>
<footer id="loginfooter" style="text-align: center;">
<span>© 2009-2017 Some Company, LLC — All rights reserved</span>
</footer>
</div>
</section>
Be careful when using width: 100% on elements removed from the normal flow of the document.
Using right: 0 instead of width: 100% could be prefered for consistency, it depends on which results you are expecting when using margins in these elements.
Using width: 100%.
div {
height: 20vh;
border: .2em solid violet;
box-sizing: border-box;
}
.relative {
position: relative;
}
.absolute {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-color: dodgerblue;
margin: .5em;
}
<div class="relative">
<div class="absolute"></div>
</div>
Using right: 0.
div {
height: 20vh;
border: .2em solid violet;
box-sizing: border-box;
}
.relative {
position: relative;
}
.absolute {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-color: dodgerblue;
margin: .5em;
}
<div class="relative">
<div class="absolute"></div>
</div>
So I know that there are other results here that are for this question, however I have a relatively "finished" code which I don't want to mess with too much if I can avoid it.
Basically I have everything on my website looking just the way I want it to, except that on larger displays the footer doesn't stick to the bottom of the screen, and there is this big ugly gap between my footer and the bottom of the screen.
Below are my index and css files. The footer element has been jostled around between the end tags, to no effect. I had it outside of my main body of content and tried bottom: 0; with position: absolute; and it just caused the right end of the footer to shoot off outside of the width I specified in my container.
.header,
.navBar,
.pageTitle {
margin: 0px;
padding: 0px;
}
body {
font-size: 20px;
background-color: #006464;
}
html,
body,
#container {
min-height: 100vh;
}
footer {
background-color: #006400;
}
nav,
h1,
h2 {
font-family: arial;
}
nav a:hover {
background-color: white;
color: black;
}
nav a {
color: white;
}
h2 {
text-align: center;
background-color: white;
}
#container {
width: 1000px;
margin: auto;
min-height: 100%;
}
#navBar {
background-color: #228B22;
padding: 10px;
}
#signUp {
color: white;
font-size: 20px;
font-family: arial;
}
#welcomeFont {
color: white;
font-size: 25px;
font-family: arial;
}
.header {
background-color: #006400;
padding: 20px;
}
.headerAnchor {
text-decoration: none;
color: black;
}
.table {
background: #006400;
max-width: 100%;
border: 1px solid black;
border-spacing: 10px;
margin-left: auto;
margin-right: auto;
}
.tableData {
font-size: 19px;
background: white;
border: 1px solid black;
padding: 8px;
opacity: .75;
}
.resizeAbout {
max-height: 50%;
max-width: 50%;
margin-top: 50px;
margin-bottom: 50px;
}
.resizeHome {
max-height: 50%;
max-width: 50%;
margin-top: 50px;
}
.resizePhotos {
max-height: 40%;
max-width: 40%;
}
.pageTitle {
padding-bottom: 0px;
box-shadow: 0px 8px 25px 0px;
}
.poetryAuthor {
color: white;
font-size: 15px;
font-family: arial;
font-style: italic;
}
.poetryCaptions {
margin-top: 50px;
color: white;
font-size: 25px;
font-family: arial;
}
<body>
<div id="container">
<header>
<h1 class="header"><a class="headerAnchor" href="index.html">TheSingularEffect.Com</a></h1>
</header>
<nav id="navBar">
Home
Music
Photos
Poetry
About
</nav>
<h2 class="pageTitle">
Get the Full Effect!
</h2>
<img class="resizeHome" src="image/homepage.jpg" alt="home page image">
<h3 id="welcomeFont">
Welcome to the home of The Singular Effect!
</h3>
<br>
<form>
<span id="signUp">Sign up for our newsletter!</span>
<br>
<input type="text" name="emailaddress" value="Email Address">
<input type="submit" value="submit">
</form>
</div>
<footer>
© 2016, Chris Hughes - SNHU
</footer>
</body>
You could try using css-tables. I tested it and seems to work as requested. The footer also expands if you add content to it.
Under body add
margin:auto;
display:table;
and under footer
display:table-row;
position:fixed;
width:1000px;
bottom: 0;
Also in this case you should probably remove the margin from the #container as it is defined in the body already.
Where I learned the trick: http://colintoh.com/blog/display-table-anti-hero#sticky-footer
I added 1 more div to target all the body content except footer so I can set the height for that element. Here are code that works:
<!DOCTYPE html>
<! Must have tables, forms, multimedia, and links >
<head>
<title>Home - The Singular Effect</title>
<link rel="stylesheet" href="css/style.css">`enter code here`
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
body {
font-size: 20px;
background-color: #006464;
}
html, body, #container {
height: 100%;
margin: 0;
}
footer {
margin-top: 50px;
background-color: #006400;
margin-bottom: 0px;
bottom: 0;
}
nav, h1, h2 {
font-family: arial;
}
nav a:hover {
background-color: white;
color: black;
}
nav a {
color: white;
}
h2 {
text-align: center;
background-color: white;
}
#container {
width: 1000px;
margin: auto;
min-height: 100%;
}
#navBar {
background-color: #228B22;
padding: 10px;
}
#signUp {
color: white;
font-size: 20px;
font-family: arial;
}
#welcomeFont {
color: white;
font-size: 25px;
font-family: arial;
}
.header {
background-color: #006400;
padding: 20px;
}
.headerAnchor {
text-decoration: none;
color: black;
}
.table {
background: #006400;
max-width: 100%;
border: 1px solid black;
border-spacing: 10px;
margin-left: auto;
margin-right: auto;
}
.tableData {
font-size: 19px;
background: white;
border: 1px solid black;
padding: 8px;
opacity: .75;
}
.resizeAbout{
max-height: 50%;
max-width: 50%;
margin-top: 50px;
margin-bottom: 50px;
}
.resizeHome{
max-height: 50%;
max-width: 50%;
margin-top: 50px;
}
.resizePhotos{
max-height: 40%;
max-width: 40%;
}
.pageTitle {
padding-bottom: 0px;
box-shadow: 0px 8px 25px 0px;
}
.poetryAuthor {
color: white;
font-size: 15px;
font-family: arial;
font-style: italic;
}
.poetryCaptions {
margin-top: 50px;
color: white;
font-size: 25px;
font-family: arial;
}
.bodyContetExceptFooter{
padding: 20px;
min-height: 90%;
margin: 0 auto -50px;
}
</style>
</head>
<body>
<div id="container">
<div class="bodyContetExceptFooter">
<header>
<h1 class="header"><a class="headerAnchor" href="index.html">TheSingularEffect.Com</a></h1>
</header>
<div id="navBar">
<nav>
Home
Music
Photos
Poetry
About
</nav>
</div>
<div id="divContent">
<h2 class="pageTitle">
Get the Full Effect!
</h2>
<img class="resizeHome" src="image/homepage.jpg" alt="home page image">
<h3 id="welcomeFont">
Welcome to the home of The Singular Effect!
</h3> <br>
<form>
<span id="signUp">Sign up for our newsletter!</span> <br>
<input type="text" name="emailaddress" value="Email Address">
<input type="submit" value="submit">
</form>
</div>
</div>
<footer>
© 2016, Chris Hughes - SNHU
</footer>
</div>
</body>
</html>
Use relative positioning on body, absolute positioning on footer and position it to left: 0; bottom 0;, also add width: 100%; to footer to fill full width of body.
One last thing is to add padding-bottom: 23px; to body to avoid footer hiding content when the height of browser is less than your content.
.header,
.navBar,
.pageTitle {
margin: 0px;
padding: 0px;
}
body {
font-size: 20px;
background-color: #006464;
position: relative; /* added */
padding-bottom: 23px; /* added, where 23px is the height of the footer */
}
html,
body,
#container {
min-height: 100vh;
}
footer {
background-color: #006400;
position: absolute; /* added */
bottom: 0; /* added */
left: 0; /* added */
width: 100%; /* added */
}
nav,
h1,
h2 {
font-family: arial;
}
nav a:hover {
background-color: white;
color: black;
}
nav a {
color: white;
}
h2 {
text-align: center;
background-color: white;
}
#container {
width: 1000px;
margin: auto;
min-height: 100%;
}
#navBar {
background-color: #228B22;
padding: 10px;
}
#signUp {
color: white;
font-size: 20px;
font-family: arial;
}
#welcomeFont {
color: white;
font-size: 25px;
font-family: arial;
}
.header {
background-color: #006400;
padding: 20px;
}
.headerAnchor {
text-decoration: none;
color: black;
}
.table {
background: #006400;
max-width: 100%;
border: 1px solid black;
border-spacing: 10px;
margin-left: auto;
margin-right: auto;
}
.tableData {
font-size: 19px;
background: white;
border: 1px solid black;
padding: 8px;
opacity: .75;
}
.resizeAbout {
max-height: 50%;
max-width: 50%;
margin-top: 50px;
margin-bottom: 50px;
}
.resizeHome {
max-height: 50%;
max-width: 50%;
margin-top: 50px;
}
.resizePhotos {
max-height: 40%;
max-width: 40%;
}
.pageTitle {
padding-bottom: 0px;
box-shadow: 0px 8px 25px 0px;
}
.poetryAuthor {
color: white;
font-size: 15px;
font-family: arial;
font-style: italic;
}
.poetryCaptions {
margin-top: 50px;
color: white;
font-size: 25px;
font-family: arial;
}
<body>
<div id="container">
<header>
<h1 class="header"><a class="headerAnchor" href="index.html">TheSingularEffect.Com</a></h1>
</header>
<nav id="navBar">
Home
Music
Photos
Poetry
About
</nav>
<h2 class="pageTitle">
Get the Full Effect!
</h2>
<img class="resizeHome" src="image/homepage.jpg" alt="home page image">
<h3 id="welcomeFont">
Welcome to the home of The Singular Effect!
</h3>
<br>
<form>
<span id="signUp">Sign up for our newsletter!</span>
<br>
<input type="text" name="emailaddress" value="Email Address">
<input type="submit" value="submit">
</form>
</div>
<footer>
© 2016, Chris Hughes - SNHU
</footer>
</body>
.header,
.navBar,
.pageTitle {
margin: 0px;
padding: 0px;
}
body {
margin: 0px;
padding: 0px;
font-size: 20px;
background-color: #006464;
}
html,
body,
#container {
min-height: 100vh;
}
footer {
background-color: #006400;
position: absolute;
bottom: 0px;
width: 100%;
}
nav,
h1,
h2 {
font-family: arial;
}
nav a:hover {
background-color: white;
color: black;
}
nav a {
color: white;
}
h2 {
text-align: center;
background-color: white;
}
#container {
width: 1000px;
margin: auto;
min-height: 100vh;
position: relative;
}
#navBar {
background-color: #228B22;
padding: 10px;
}
#signUp {
color: white;
font-size: 20px;
font-family: arial;
}
#welcomeFont {
color: white;
font-size: 25px;
font-family: arial;
}
.header {
background-color: #006400;
padding: 20px;
}
.headerAnchor {
text-decoration: none;
color: black;
}
.table {
background: #006400;
max-width: 100%;
border: 1px solid black;
border-spacing: 10px;
margin-left: auto;
margin-right: auto;
}
.tableData {
font-size: 19px;
background: white;
border: 1px solid black;
padding: 8px;
opacity: .75;
}
.resizeAbout {
max-height: 50%;
max-width: 50%;
margin-top: 50px;
margin-bottom: 50px;
}
.resizeHome {
max-height: 50%;
max-width: 50%;
margin-top: 50px;
}
.resizePhotos {
max-height: 40%;
max-width: 40%;
}
.pageTitle {
padding-bottom: 0px;
box-shadow: 0px 8px 25px 0px;
}
.poetryAuthor {
color: white;
font-size: 15px;
font-family: arial;
font-style: italic;
}
.poetryCaptions {
margin-top: 50px;
color: white;
font-size: 25px;
font-family: arial;
}
<!DOCTYPE html>
<head>
<title>Home - The Singular Effect</title>
</head>
<body>
<div id="container">
<header>
<h1 class="header"><a class="headerAnchor" hreF="index.html">TheSingularEffect.Com</a></h1>
</header>
<nav id="navBar">
Home
Music
Photos
Poetry
About
</nav>
<h2 class="pageTitle">
Get the Full Effect!
</h2>
<img class="resizeHome" src="image/homepage.jpg" alt="home page image">
<h3 id="welcomeFont">
Welcome to the home of The Singular Effect!
</h3>
<br>
<form>
<span id="signUp">Sign up for our newsletter!</span>
<br>
<input type="text" name="emailaddress" value="Email Address">
<input type="submit" value="submit">
</form>
<footer>
© 2016, Chris Hughes - SNHU
</footer>
</div>
</body>
On the site i am making, one-paged site, the first div should always has the height of 100%, however this isnt working, the div does not cover all the height size of the screen.
At the moment, the div (header) has the weight set to 650px and its fine on 1336x768 resolution, but not different resolutions. When i set height:100%; it doesnt happen, does not make div have all the height of the screen on different resolutions.
I think its a css error, but cant figure it out yet.
I hope you can understand.
body {
margin: 0;
font-family: 'Open Sans', Helvetica, sans-serif;
min-width: 900px;
}
.header {
background-image: url("img/fundo1.jpg");
background-color: rgb(21, 21, 21);
color: white;
height: auto;
min-height: 650px;
position: relative;
}
.header .logo {
width: 230px;
height: 60px;
margin: 20px 8px 8px 6%;
}
.header .menu {
position: absolute;
top: 55px; right: 25px;
}
.header .menu a {
margin: 0 4px;
font-size: 15px;
color: white;
text-decoration: none;
padding: 6px 20px;
}
.header .menu a:hover,
.header .menu a.current {
color: rgb(204, 66, 63);
}
.header .move {
color: white;
width: 40%;
margin: 0;
padding: 10px;
}
.header .move .center {
margin: 260px auto 0;
width: 360px;
}
.header .move h1 {
font-weight: 400;
font-size: 38px;
margin: 6px 0;
}
.header .move p {
font-weight: 300;
font-size: 20px;
border-top: 2px solid white;
margin: 6px 0;
padding-top: 6px;
}
.header .mail1 {
background-image: url("img/email.png");
background-size: contain;
background-position: 100% 100%;
background-repeat: no-repeat;
width: 560px; height: 560px;
position: absolute;
bottom: 0; right: 0;
}
.header .mail1 form {
position: absolute;
width: 240px;
bottom: 220px; right: 155px;
}
.header .mail1 h1 {
font-weight: 300;
text-align: center;
color: rgb(203, 41, 37);
}
.header .mail1 input {
box-sizing: border-box;
width: 100%;
font-family: 'Open Sans', Helvetica, sans-serif;
padding: 8px;
border: 1px solid rgb(219, 219, 218);
border-radius: 6px;
margin-bottom: 12px;
}
.header .mail1 input:hover {
border: 1px solid rgb(189, 189, 188);
}
.header .mail1 input:focus {
outline: 0;
}
.header .mail1 a {
display: block;
color: white;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 6px;
text-align: center;
padding: 8px;
font-size: 14px;
}
.header .mail1 a:hover {
background-color: rgb(224, 86, 83);
}
.mail2 {
background-color: white;
background-image: url("img/barra.png");
background-position: 12% 0%;
height: 110px;
text-align: right;
}
.mail2.fixed {
position: fixed;
display:block;
top: 0; left: 0;
width: 100%;
min-width: 800px;
height: 110px;
z-index: 1;
}
.mail2 form {
display: inline-block;
margin: 36px 0;
padding: 0 10px;
width: 600px;
}
.mail2 h1 {
font-weight: 300;
color: rgb(203, 41, 37);
display: inline;
vertical-align: middle;
font-size: 28px;
}
.mail2 input {
box-sizing: border-box;
width: 220px;
font-family: 'Open Sans', Helvetica, sans-serif;
padding: 8px;
border: 1px solid rgb(219, 219, 218);
border-radius: 6px;
margin: 0 6px;
}
.mail2 input:hover {
border: 1px solid rgb(189, 189, 188);
}
.mail2 input:focus {
outline: 0;
}
.mail2 a {
display: inline;
color: white;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 6px;
text-align: center;
padding: 8px 4%;
font-size: 14px;
}
.mail2 a:hover {
background-color: rgb(224, 86, 83);
}
.mail2 .top {
padding: 8px 6px;
background-color: rgb(51, 51, 51);
}
.mail2 .top:hover {
background-color: rgb(71, 71, 71);
}
.optimize {
background-image: url("img/fundo2.jpg");
background-size: cover;
background-color: rgb(21, 21, 21);
color: white;
padding-bottom: 48.1%;
}
.optimize.fixed {
margin-top: 110px;
}
.barra2 {
background-image: url('img/barra2.png');
background-size: cover;
padding-bottom: 21.6%;
}
.mobile {
background-image: url("img/fundo3.jpg");
background-size: cover;
background-color: rgb(171, 171, 171);
color: white;
padding-bottom: 44.4%;
position: relative;
}
.mobile .invisi {
position: absolute;
width: 13%;
height: 10%;
bottom: 14%;
border-radius: 8px;
}
.mobile .invisi:hover {
background: white;
opacity: 0.2;
}
.mobile .appstore {
right: 26.5%;
}
.mobile .googleplay {
right: 11.5%;
}
.contact {
background-image: url("img/fundo2es.jpg");
background-size: cover;
background-color: rgb(21, 21, 21);
background-repeat: no-repeat;
height:100%;
color:white;
}
.contact .textocon {
text-align: right;
padding: 55px 75px 0 0;
}
.contact .textocon div {
display: inline-block;
width: 290px
}
.contact .textocon h1 {
font-weight: 400;
font-size: 42px;
margin: 6px 0;
}
.contact .textocon p {
font-weight: 300;
font-size: 19px;
border-top: 2px solid white;
margin: 6px 0;
padding-top: 6px;
}
.contact .col1 {
display: inline-block;
vertical-align: top;
width: 410px;
padding: 10px 6px 10px 60px;
}
.contact .col1 h1 {
font-weight: 300;
font-size: 25px;
margin: 4px 0;
}
.contact .col1 input {
width: 380px;
height: 20px;
}
.contact .col1 input,
.contact .col2 textarea {
font-family: 'Open Sans', Helvetica, sans-serif;
padding: 14px;
font-size: 13px;
color: white;
background-color: transparent;
border: 1px solid rgb(172, 161, 160);
margin: 6px 0;
}
.contact .col1 input:focus,
.contact .col2 textarea:focus {
outline: 0;
border: 1px solid white;
}
.contact .col2 {
display: inline-block;
width: calc(100% - 560px);
padding: 52px 10px 10px 0;
text-align: right;
}
.contact .col2 textarea {
text-align: left;
width: 100%;
box-sizing: border-box;
height: 112px;
}
.contact .col2 a {
display: inline-block;
color: white;
font-weight: bold;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 6px;
padding: 12px 60px;
font-size: 20px;
}
.contact .col2 a:hover {
background-color: rgb(224, 86, 83);
}
.contact .info {
padding: 10px 60px;
display: flex;
justify-content: space-between;
}
.contact .info h1 {
font-weight: 300;
font-size: 25px;
}
.contact .info p {
font-size: 12px;
line-height: 12px;
}
.contact .info a {
text-decoration: none;
color: white;
}
.contact .info a:hover {
color: #ddd;
}
.contact .info img {
width: 32px;
margin: 6px;
}
.contact .info img:hover {
opacity: 0.8;
}
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/prefixfree.min.js"></script>
<script src="js/fixedbar.js"></script>
<meta charset="utf-8">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" rel="stylesheet" type="text/css">
<link href="styles.css" rel="stylesheet" type="text/css">
<title> Layout </title>
</head>
<body>
<div class="header" id="top">
<img class="logo" src="img/logo.png">
<div class="menu">
Home
Product Tour
Pricing
Try
Vision
</div>
<div class="move">
<div class="center">
<h1>Move work forward!</h1>
<p>Optential keeps your team organized, connected, and focused on results.</p>
</div>
</div>
<div class="mail1">
<form>
<h1>Try Now!</h1>
<input type="text" placeholder="Your Email here...">
Get started for free
</form>
</div>
</div>
<div class="mail2">
<form>
<h1>Try Now!</h1>
<input type="text" placeholder="Your Email here...">
Get started for free
<a class="top" href="#top">Top</a>
</form>
</div>
<div class="optimize"></div>
<div class="barra2"></div>
<div class="mobile">
</div>
<div class="contact">
<div class="textocon">
<div>
<h1>Optential</h1>
<p>A new management system<br>for a new management paradigm!</p>
</div>
</div>
<form>
<div class="col1">
<h1>Contact us!</h1>
<input type="text" name="nome" size="50" placeholder="Name"/>
<input type="text" name="email" size="50" placeholder="Email"/>
<input type="text" name="subjet" size="50" placeholder="Subject"/>
</div>
<div class="col2">
<textarea name="message" rows="5" cols="70" placeholder="Message..."></textarea>
Send
</div>
</form>
<div class="info">
<div>
<h1>Mail Us !</h1>
<p>Rua Andrade Corvo, 242</p>
<p>sala 206</p>
<p>4700-204 Braga</p>
<p>Portugal</p>
</div>
<div>
<h1>Call Us !</h1>
<p>+351 987654323</p>
<p>+351 987654323</p>
<p>+351 987654323</p>
</div>
<div>
<h1>Email Us! </h1>
<p>code#angel.com</p>
<p>code_hr#angel.com</p>
<p>code_support#angel.com</p>
</div>
<div>
<h1>Join Us! </h1>
<img src="img/facebook.png">
<img src="img/gplus.png">
<img src="img/twitter.png">
<img src="img/instag.png">
</div>
</div>
</div>
</body>
</html>
Try to add the following css to your code:
html,
body { height: 100%; }
.header {
(...)
height: 100%;
}
See a demo here: CodePen
it wont be set to 100%, 100% of height will only work for the amount of content it has, you will have to set the height by javascript..if your content takes a height of 300px then 100% will taken as 100% of 300px,and no the browser height
got a solution using css
html
{
height:100%;
}
.header:
{
height:100%;
}
this will do your job.
Add height:100% to html,body and .header.
Remove min-height:650 from .header.
html {
height:100%; /*added*/
}
body {
margin: 0;
font-family: 'Open Sans', Helvetica, sans-serif;
min-width: 900px;
height:100%; /*added*/
}
.header {
background-image: url("img/fundo1.jpg");
background-color: rgb(21, 21, 21);
color: white;
height:100%;
position: relative;
}
.header .logo {
width: 230px;
height: 60px;
margin: 20px 8px 8px 6%;
}
.header .menu {
position: absolute;
top: 55px; right: 25px;
}
.header .menu a {
margin: 0 4px;
font-size: 15px;
color: white;
text-decoration: none;
padding: 6px 20px;
}
.header .menu a:hover,
.header .menu a.current {
color: rgb(204, 66, 63);
}
.header .move {
color: white;
width: 40%;
margin: 0;
padding: 10px;
}
.header .move .center {
margin: 260px auto 0;
width: 360px;
}
.header .move h1 {
font-weight: 400;
font-size: 38px;
margin: 6px 0;
}
.header .move p {
font-weight: 300;
font-size: 20px;
border-top: 2px solid white;
margin: 6px 0;
padding-top: 6px;
}
.header .mail1 {
background-image: url("img/email.png");
background-size: contain;
background-position: 100% 100%;
background-repeat: no-repeat;
width: 560px; height: 560px;
position: absolute;
bottom: 0; right: 0;
}
.header .mail1 form {
position: absolute;
width: 240px;
bottom: 220px; right: 155px;
}
.header .mail1 h1 {
font-weight: 300;
text-align: center;
color: rgb(203, 41, 37);
}
.header .mail1 input {
box-sizing: border-box;
width: 100%;
font-family: 'Open Sans', Helvetica, sans-serif;
padding: 8px;
border: 1px solid rgb(219, 219, 218);
border-radius: 6px;
margin-bottom: 12px;
}
.header .mail1 input:hover {
border: 1px solid rgb(189, 189, 188);
}
.header .mail1 input:focus {
outline: 0;
}
.header .mail1 a {
display: block;
color: white;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 6px;
text-align: center;
padding: 8px;
font-size: 14px;
}
.header .mail1 a:hover {
background-color: rgb(224, 86, 83);
}
.mail2 {
background-color: white;
background-image: url("img/barra.png");
background-position: 12% 0%;
height: 110px;
text-align: right;
}
.mail2.fixed {
position: fixed;
display:block;
top: 0; left: 0;
width: 100%;
min-width: 800px;
height: 110px;
z-index: 1;
}
.mail2 form {
display: inline-block;
margin: 36px 0;
padding: 0 10px;
width: 600px;
}
.mail2 h1 {
font-weight: 300;
color: rgb(203, 41, 37);
display: inline;
vertical-align: middle;
font-size: 28px;
}
.mail2 input {
box-sizing: border-box;
width: 220px;
font-family: 'Open Sans', Helvetica, sans-serif;
padding: 8px;
border: 1px solid rgb(219, 219, 218);
border-radius: 6px;
margin: 0 6px;
}
.mail2 input:hover {
border: 1px solid rgb(189, 189, 188);
}
.mail2 input:focus {
outline: 0;
}
.mail2 a {
display: inline;
color: white;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 6px;
text-align: center;
padding: 8px 4%;
font-size: 14px;
}
.mail2 a:hover {
background-color: rgb(224, 86, 83);
}
.mail2 .top {
padding: 8px 6px;
background-color: rgb(51, 51, 51);
}
.mail2 .top:hover {
background-color: rgb(71, 71, 71);
}
.optimize {
background-image: url("img/fundo2.jpg");
background-size: cover;
background-color: rgb(21, 21, 21);
color: white;
padding-bottom: 48.1%;
}
.optimize.fixed {
margin-top: 110px;
}
.barra2 {
background-image: url('img/barra2.png');
background-size: cover;
padding-bottom: 21.6%;
}
.mobile {
background-image: url("img/fundo3.jpg");
background-size: cover;
background-color: rgb(171, 171, 171);
color: white;
padding-bottom: 44.4%;
position: relative;
}
.mobile .invisi {
position: absolute;
width: 13%;
height: 10%;
bottom: 14%;
border-radius: 8px;
}
.mobile .invisi:hover {
background: white;
opacity: 0.2;
}
.mobile .appstore {
right: 26.5%;
}
.mobile .googleplay {
right: 11.5%;
}
.contact {
background-image: url("img/fundo2es.jpg");
background-size: cover;
background-color: rgb(21, 21, 21);
background-repeat: no-repeat;
height:100%;
color:white;
}
.contact .textocon {
text-align: right;
padding: 55px 75px 0 0;
}
.contact .textocon div {
display: inline-block;
width: 290px
}
.contact .textocon h1 {
font-weight: 400;
font-size: 42px;
margin: 6px 0;
}
.contact .textocon p {
font-weight: 300;
font-size: 19px;
border-top: 2px solid white;
margin: 6px 0;
padding-top: 6px;
}
.contact .col1 {
display: inline-block;
vertical-align: top;
width: 410px;
padding: 10px 6px 10px 60px;
}
.contact .col1 h1 {
font-weight: 300;
font-size: 25px;
margin: 4px 0;
}
.contact .col1 input {
width: 380px;
height: 20px;
}
.contact .col1 input,
.contact .col2 textarea {
font-family: 'Open Sans', Helvetica, sans-serif;
padding: 14px;
font-size: 13px;
color: white;
background-color: transparent;
border: 1px solid rgb(172, 161, 160);
margin: 6px 0;
}
.contact .col1 input:focus,
.contact .col2 textarea:focus {
outline: 0;
border: 1px solid white;
}
.contact .col2 {
display: inline-block;
width: calc(100% - 560px);
padding: 52px 10px 10px 0;
text-align: right;
}
.contact .col2 textarea {
text-align: left;
width: 100%;
box-sizing: border-box;
height: 112px;
}
.contact .col2 a {
display: inline-block;
color: white;
font-weight: bold;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 6px;
padding: 12px 60px;
font-size: 20px;
}
.contact .col2 a:hover {
background-color: rgb(224, 86, 83);
}
.contact .info {
padding: 10px 60px;
display: flex;
justify-content: space-between;
}
.contact .info h1 {
font-weight: 300;
font-size: 25px;
}
.contact .info p {
font-size: 12px;
line-height: 12px;
}
.contact .info a {
text-decoration: none;
color: white;
}
.contact .info a:hover {
color: #ddd;
}
.contact .info img {
width: 32px;
margin: 6px;
}
.contact .info img:hover {
opacity: 0.8;
}
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/prefixfree.min.js"></script>
<script src="js/fixedbar.js"></script>
<meta charset="utf-8">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" rel="stylesheet" type="text/css">
<link href="styles.css" rel="stylesheet" type="text/css">
<title> Layout </title>
</head>
<body>
<div class="header" id="top">
<img class="logo" src="img/logo.png">
<div class="menu">
Home
Product Tour
Pricing
Try
Vision
</div>
<div class="move">
<div class="center">
<h1>Move work forward!</h1>
<p>Optential keeps your team organized, connected, and focused on results.</p>
</div>
</div>
<div class="mail1">
<form>
<h1>Try Now!</h1>
<input type="text" placeholder="Your Email here...">
Get started for free
</form>
</div>
</div>
<div class="mail2">
<form>
<h1>Try Now!</h1>
<input type="text" placeholder="Your Email here...">
Get started for free
<a class="top" href="#top">Top</a>
</form>
</div>
<div class="optimize"></div>
<div class="barra2"></div>
<div class="mobile">
</div>
<div class="contact">
<div class="textocon">
<div>
<h1>Optential</h1>
<p>A new management system<br>for a new management paradigm!</p>
</div>
</div>
<form>
<div class="col1">
<h1>Contact us!</h1>
<input type="text" name="nome" size="50" placeholder="Name"/>
<input type="text" name="email" size="50" placeholder="Email"/>
<input type="text" name="subjet" size="50" placeholder="Subject"/>
</div>
<div class="col2">
<textarea name="message" rows="5" cols="70" placeholder="Message..."></textarea>
Send
</div>
</form>
<div class="info">
<div>
<h1>Mail Us !</h1>
<p>Rua Andrade Corvo, 242</p>
<p>sala 206</p>
<p>4700-204 Braga</p>
<p>Portugal</p>
</div>
<div>
<h1>Call Us !</h1>
<p>+351 987654323</p>
<p>+351 987654323</p>
<p>+351 987654323</p>
</div>
<div>
<h1>Email Us! </h1>
<p>code#angel.com</p>
<p>code_hr#angel.com</p>
<p>code_support#angel.com</p>
</div>
<div>
<h1>Join Us! </h1>
<img src="img/facebook.png">
<img src="img/gplus.png">
<img src="img/twitter.png">
<img src="img/instag.png">
</div>
</div>
</div>
</body>
</html>