CSS: Fix positioning of input in Log-In form - html

I'm trying fix the Log-In & registration form. When you click on "Register" on my menu, you can see that the labels are perfectly formatted in the form but the input box are offset. I tried to fix it with float:left but it didn't work out too well. If somebody could help me with that, that would be awesome.
var popup = document.getElementById('id01');
var popupreg = document.getElementById('id02');
window.onclick = function(event) {
if (event.target == popup) {
popup.style.display = "none";
}
if (event.target == popupreg) {
popupreg.style.display = "none";
}
}
body {
margin: 0 auto;
background: #fff;
}
div.container {
text-align: center;
box-sizing: border-box;
margin: 0 auto;
padding: 5px;
background-color: #000;
}
a.nounderline span {
color: #00B200;
}
.main-menu {
width: 200px;
margin: 0 auto;
right: 26px;
position: fixed;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
height: 35%;
}
.floating-sidebar li {
text-decoration: none;
outline: none;
line-height: 2em;
display: block;
border-radius: auto;
position: relative;
top: 10px;
-webkit-transition: none;
-o-transition: none;
transition: none;
}
.floating-sidebar li a {
background-color: #fff;
color: #444950;
display: block;
padding: 7px;
text-decoration: none;
font-family: Arial, sans-serif;
font-size: 18;
font-weight: bold;
border-radius: 9px;
}
.floating-sidebar li a:hover {
background-color: #eee;
color: #00B200;
}
.floating-sidebar li a.active {
background-color: #eee;
color: #00B200;
}
.floating-sidebar:hover li a.register-link {
color: #b5e7a0;
background: #fff;
}
.floating-sidebar li a.active:hover {
background-color: #00B200;
color: #fff;
}
.topnav input[type=text] {
float: left;
padding: 4.5px;
padding-left: 28px;
width: 305px;
border: 2px solid #00B200;
border-radius: 18px;
outline: inherit;
margin-top: 80px;
margin-left: 115px;
font-family: Arial, sans-serif;
font-weight: bold;
font-size: 18px;
direction: inherit;
}
input::placeholder {
color: #BEBEBE;
}
span.topnav {
right: 50px;
}
.sortby-box {
padding-top: 124px;
padding-left: 44;
margin: 0 auto;
position: fixed;
}
.select-opt {
padding: 4px;
width: 120px;
border-radius: 8px;
outline: none;
border: 1px solid #00B200;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.select-opt option {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.popup,
.popupreg {
display: none;
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.8);
/* Black w/ opacity */
padding-top: 60px;
}
.popup-content,
.popupreg-content {
float: left;
position: fixed;
background-color: rgb(245, 245, 245);
width: 600px;
height: 400px;
border-radius: 39px;
left: 666px;
top: 210px;
border: 2px solid rgb(109, 196, 109);
}
.popup,
.popupreg label {
font-family: Arial, Helvetica, sans-serif;
}
.popup [type=text],
[type=password] {
padding: 6px 8px;
width: 250px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
margin: 10px 0;
margin-left: 15px;
box-sizing: border-box;
}
.popupreg [type=text],
[type=password] {
padding: 6px 8px;
width: 250px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
margin: 10px 0;
margin-left: 15px;
box-sizing: border-box;
}
.popup input[type=submit] {
padding: 8px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
}
.popupreg input[type=submit] {
padding: 8px;
border-radius: 12px;
border: 1px solid gray;
outline: none;
}
.popup [type=submit] {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-color: #fff;
color: #00B200;
font-size: 22px;
padding: 180px;
margin-left: 88px;
margin-top: 5px;
width: 250px;
height: 60px;
}
.popupreg [type=submit] {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
background-color: #fff;
color: #00B200;
font-size: 22px;
padding: 180px;
margin-left: 88px;
margin-top: 5px;
width: 250px;
height: 60px;
}
.popup .submit-log:hover {
color: #fff;
background-color: #00B200;
cursor: pointer;
}
.popupreg .submit-log:hover {
color: #fff;
background-color: #00B200;
cursor: pointer;
}
.cancel {
text-align: right;
position: relative;
cursor: pointer;
}
.close {
position: absolute;
right: 25px;
top: 0;
color: #000;
font-size: 35px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: red;
cursor: pointer;
}
.username-section,
.reg-section {
padding: 32px;
margin-left: 75px;
margin-top: 20px;
}
span.psswrd {
float: right;
padding-top: 16px;
}
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
<header>
<div class="container">
Hello
</div>
</header>
<main>
<aside>
</aside>
</main>
<sidebar>
<div class="main-menu">
<ul class="floating-sidebar">
<li>Log In</li>
<li>Register</li>
<li>About</li>
<li>Language</li>
</ul>
</div>
</sidebar>
<div class="sortby-box">
<select class="select-opt">
<option>Newest</option>
<option>Popularity</option>
<option>Recommended</option>
</select>
</div>
<div class="topnav">
<input style="position:relative;" type="text" name: "searchText" placeholder="Search here.." maxlength="18">
<span style="position:absolute; left: 126px; top: 119px;" class="fa fa-search icon"></span>
</div>
<div id="id01" class="popup">
<form class="popup-content" action="/action_page.php" method="get">
<div class="cancel">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="username-section">
<label for="usrname">Username</label>
<input type="text" id="usrname" name="usrname" minlength="6" maxlength="20"><br><br>
<label for="psswrd">Password</label>
<input type="password" id="passwrd" name="psswrd" minlength="6" maxlength="20"><br><br>
<input type="submit" class="submit-log" value="Log In">
</div>
</form>
</div>
<div id="id02" class="popupreg">
<form class="popupreg-content" action="/action_page.php" method="get">
<div class="cancel">
<span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">×</span>
</div>
<div class="reg-section">
<label for="usrname">Username</label>
<input type="text" id="usrname" name="usrname" minlength="6" maxlength="20"><br><br>
<label for="usrname">Mail</label>
<input type="text" id="mail" name="mail" minlength="6" maxlength="20"><br><br>
<label for="psswrd">Password</label>
<input type="password" id="passwrd" name="psswrd" minlength="6" maxlength="20"><br><br>
<input type="submit" class="submit-log" value="Register">
</div>
</form>
</div>
<script src="index.js"></script>
<footer>
</footer>

A simple fix would be to give the label elements a display: inline-block; and give them a defined width such as width: 100px;.
I quickly created a JSFiddle to illustrate.
Hope this helped.

Related

is there anyway to move this login card to the center

I created a dropdown menu and set the position: absolute; and my login card move to the left of the title instead I want it to be in the middle of the title. is there any way I can do it?
Thank you and sorry for my bad English
HTML:
<li>
<div class="drop">
<span><i class="fas fa-caret-down"></i> Thành Viên</span>
<div class="drop_menu">
<div id="login_title">
<h2>LOGIN</h2>
<div class="under_login"></div>
</div>
<div class="dropdown_login ">
<form method="post" class="form">
<label for="user-email" style="padding-top:13px">
Email
</label>
<input id="user-email" class="form-content" type="email" name="email" autocomplete="on" required />
<div class="form-border"></div>
<label for="user-password" style="padding-top:22px"> Password
</label>
<input id="user-password" class="form-content" type="password" name="password" required />
<div class="form-border"></div>
<a href="#">
<legend id="forgot-pass">Forgot password?</legend>
</a>
<input id="submit-btn" type="submit" name="submit" value="LOGIN" />
Don't have account yet?
</form>
</div>
</div>
</div>
</li>
CSS:
.nav_bar {
width: 100%;
height: 80px;
background: url(../pic/bg_menu.png);
border: 0.5px solid rgb(179, 41, 41);
box-shadow: 0 4px 2px -2px rgb(99, 99, 99);
text-align: center;
}
.nav_bar div.menu_br {
position: absolute;
margin-left: 50px;
text-align: center;
float: left;
}
.menu_br img {
margin-top: 2.5px;
max-width: 78%;
}
.nav_bar ul {
margin-top: 20px;
position: relative;
}
.nav_bar ul li {
list-style-type: none;
padding-top: 5px;
padding-left: 20px;
padding-right: 20px;
font-size: 25px;
font-family: 'Nunito', sans-serif;
color: white;
display: inline-block;
}
.nav_bar ul li:hover {
text-decoration: underline;
}
#need_br {
border-right: 0.5px solid rgb(102, 102, 102);
}
.drop_menu {
position: absolute;
display: none;
background: #fbfbfb;
border-radius: 8px;
box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.65);
margin-right: 300px;
height: 410px;
width: 329px;
z-index: 1;
}
.dropdown_menu_show {
display: block;
}
.dropdown_login {
color: black;
padding: 12px 44px;
}
#login_title {
font-family: "Raleway Thin", sans-serif;
color: #000;
letter-spacing: 4px;
padding-bottom: 23px;
padding-top: 23px;
text-align: center;
}
.under_login {
background: -webkit-linear-gradient(right, #f77b7b, #c0382e);
height: 2px;
width: 89px;
margin: auto;
}
#signup {
color: #bd2d2d;
font-family: "Raleway", sans-serif;
font-size: 10pt;
margin-top: 16px;
text-align: center;
}
label {
font-family: "Raleway", sans-serif;
font-size: 11pt;
}
#forgot-pass {
color: #bd2d2d;
font-family: "Raleway", sans-serif;
font-size: 10pt;
margin-top: 3px;
text-align: right;
}
#submit-btn {
background: -webkit-linear-gradient(right, #f77b7b, #bd2d2d);
border: none;
border-radius: 21px;
box-shadow: 0px 1px 8px #c62424;
cursor: pointer;
color: white;
font-family: "Raleway SemiBold", sans-serif;
height: 42.3px;
margin: 0 auto;
margin-top: 50px;
transition: 0.25s;
width: 153px;
}
#submit-btn:hover {
box-shadow: 0px 1px 18px #c62424;
}
.form {
align-items: left;
display: flex;
flex-direction: column;
}
.form-border {
background: -webkit-linear-gradient(right, #f77b7b, #c02e2e);
height: 1px;
width: 100%;
}
.form-content {
background: #fbfbfb;
border: none;
outline: none;
padding-top: 14px;
}
The dropdown needs to have
position: relative;
and then you can move it to the left using
right: 500px; or whatever amount you want.
drop_menu {
position: absolute;
display: none;
background: #fbfbfb;
border-radius: 8px;
box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.65);
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 410px;
width: 329px;
z-index: 1;
}
use this css for dropdown

How to change the layout of a sign-up page

I'm trying to change my sign-up page so that the avatar is to the left and the username, password boxes etc are to the right. I've tried using split divs but this doesn't seem to work. I've also tried positioning the avatar to the left but that also hasn't worked. Here is my style and body code.
body {
font-family: Arial, Helvetica, sans-serif;
}
form {
border: 3px solid #f1f1f1;
}
* {
margin: 0;
padding: 0;
}
#logo {
float: left;
display: inline-block;
object-fit: none;
background: transparent;
padding-bottom: 0;
padding-top: 0;
padding-left: 10px;
}
.navbar {
overflow: hidden;
background-color: #D47ACE;
position: fixed;
top: 0;
width: 100%;
z-index: 1001;
}
.navbar-logo {
font-size: 25px;
word-spacing: 0px;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 15px 18px;
text-decoration: none;
font-size: 23px;
font-style: normal;
font-family: "Rockwell", Monaco, monospace;
letter-spacing: 0px;
word-spacing: 5px;
font-weight: 700;
}
#nav li {
display: inline;
padding-right: 30px;
}
.navbar a:hover {
color: #ffffff;
}
#demoFont {
font-family: "Lucida Console", Monaco, monospace;
font-size: 29px;
letter-spacing: 5.2px;
word-spacing: 2px;
color: #000000;
font-weight: 700;
text-decoration: none;
font-style: normal;
font-variant: normal;
text-transform: uppercase;
}
input[type=text],
input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: pink;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
}
img.avatar {
width: 40%;
border-radius: 50%;
padding-top: 10vh;
padding-bottom: 0vh;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
.button {
background-color: pink;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
<form action="/action_page.php" method="post">
<div class="imgcontainer">
<img src="https://via.placeholder.com/568" alt="Avatar" class="avatar">
</div>
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Enter</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot password?</span>
</div>
</form>
Any help would be great.
You can use display: flex; property as shown in the below sample.
body {
font-family: Arial, Helvetica, sans-serif;
}
form {
border: 3px solid #f1f1f1;
}
* {
margin: 0;
padding: 0;
}
.d-flex{
display: flex;
flex-wrap: wrap;
align-items: center;
}
.img-container, .input-container {
width: 50%;
}
.img-container {
text-align: center;
}
#logo {
display: inline-block;
object-fit: none;
background: transparent;
padding-bottom: 0;
padding-top: 0;
padding-left: 10px;
}
.navbar {
overflow: hidden;
background-color: #D47ACE;
position: fixed;
top: 0;
width: 100%;
z-index: 1001;
}
.navbar-logo {
font-size: 25px;
word-spacing: 0px;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 15px 18px;
text-decoration: none;
font-size: 23px;
font-style: normal;
font-family: "Rockwell", Monaco, monospace;
letter-spacing: 0px;
word-spacing: 5px;
font-weight: 700;
}
#nav li {
display: inline;
padding-right: 30px;
}
.navbar a:hover {
color: #ffffff;
}
#demoFont {
font-family: "Lucida Console", Monaco, monospace;
font-size: 29px;
letter-spacing: 5.2px;
word-spacing: 2px;
color: #000000;
font-weight: 700;
text-decoration: none;
font-style: normal;
font-variant: normal;
text-transform: uppercase;
}
input[type=text],
input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: pink;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
}
img.avatar {
width: 40%;
border-radius: 50%;
padding-top: 10vh;
padding-bottom: 0vh;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
.button {
background-color: pink;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
<form action="/action_page.php" method="post" class="d-flex">
<div class="img-container">
<img src="https://via.placeholder.com/140x100" alt="Avatar" class="avatar">
</div>
<div class="input-container">
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Enter</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot password?</span>
</div>
</div>
</form>
One thing you can do is add a display: flex on the form, setting its contents to wrap when there is no more available space on the line. Then you can set a width of 100% on the last .container which is housing the cancel button and forgotten password link, forcing it to a new line.
Here is that new CSS:
form {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.imgcontainer .avatar {
padding-top: 0;
}
/* .imgcontainer+.container means the .container adjacent to `.imgcontainer */
.imgcontainer,
.imgcontainer+.container {
flex: 1;
}
/* .container+.container means the last .container in your case */
.container+.container {
width: 100%;
}
Which produces:
Demo
form {
display: flex;
flex-wrap: wrap;
align-items: center;
}
.imgcontainer,
.imgcontainer+.container {
flex: 1;
}
.imgcontainer .avatar {
padding-top: 0;
}
.container+.container {
width: 100%;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
form {
border: 3px solid #f1f1f1;
}
* {
margin: 0;
padding: 0;
}
#logo {
float: left;
display: inline-block;
object-fit: none;
background: transparent;
padding-bottom: 0;
padding-top: 0;
padding-left: 10px;
}
.navbar {
overflow: hidden;
background-color: #D47ACE;
position: fixed;
top: 0;
width: 100%;
z-index: 1001;
}
.navbar-logo {
font-size: 25px;
word-spacing: 0px;
}
.navbar a {
float: left;
display: block;
color: white;
text-align: center;
padding: 15px 18px;
text-decoration: none;
font-size: 23px;
font-style: normal;
font-family: "Rockwell", Monaco, monospace;
letter-spacing: 0px;
word-spacing: 5px;
font-weight: 700;
}
#nav li {
display: inline;
padding-right: 30px;
}
.navbar a:hover {
color: #ffffff;
}
#demoFont {
font-family: "Lucida Console", Monaco, monospace;
font-size: 29px;
letter-spacing: 5.2px;
word-spacing: 2px;
color: #000000;
font-weight: 700;
text-decoration: none;
font-style: normal;
font-variant: normal;
text-transform: uppercase;
}
input[type=text],
input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: pink;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
}
img.avatar {
width: 40%;
border-radius: 50%;
padding-top: 10vh;
padding-bottom: 0vh;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
.button {
background-color: pink;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
<form action="/action_page.php" method="post">
<div class="imgcontainer">
<img src="https://via.placeholder.com/568" alt="Avatar" class="avatar">
</div>
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Enter</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot password?</span>
</div>
</form>

login form submit button responsitivity issue?

I have coded a login form but it has responsitivity issues with it's submit button and along I want the padding inside the form to decrease also. I do know media queries but I don't want to use those so if you people can propose a solution without using media queries as :
/* VMS Forms ((START)) */
.vms-form-container {
margin: 0 auto;
}
.vms-form-container a {
text-decoration: none;
}
.vms-form-footer a:hover {
color: white;
}
.vms-form-footer a:visited {
color: white;
}
.vms-form {
text-align: center;
border: 1px solid #a68888;
padding: 9% 17% 8% 17%;
font-family: Arial;
}
.vms-form-footer {
text-align: center;
padding: 7% 17% 7% 17%;
background-color: rgb(37, 80, 87);
color: white;
}
.vms-form-inner {
margin-top: 37px;
}
.vms-form-inner input {
display: block;
margin:0 auto;
padding: 7px;
width: 73%;
margin-bottom: 15px;
border: 1px solid #d6cfcf;
}
.vms-form-inner input:focus {
border: 1px solid rgb(221,129,126);
}
.vms-form-inner .vms-form-submit {
background-color: rgb(199, 109, 106);
display: block;
padding: 7px 121px 7px 121px;
color: white;
border-radius: 2px;
}
.vms-form-inner .vms-form-submit span {
position: absolute;
margin-top: -25px;
margin-left: 130px;
display: block;
background-color: rgb(184, 98, 95);
padding: 5px 11px 5px 11px;
border-radius: 2px;
}
.vms-form-inner a {
text-align: right;
display: block;
width: 342px;
font-size: 12px;
}
.vms-form-title {
font-size: 175%;
color: #483535;
letter-spacing: 2.5px;
margin-bottom: 10px;
}
.vms-form-title-bold {
font-weight: bold;
}
.vms-form-title-bottom-border {
width: 80px;
height: 1px;
margin: 0px auto;
border-bottom: 2px solid #483535;
}
/* VMS Forms ((END)) */
<div class="container" style="padding-top: 60px;padding-bottom: 60px;">
<!-- VMS Form -->
<div class="vms-form-container col-sm-8">
<div class="vms-form">
<div class="vms-form-title">
VENUE <span class="vms-form-title-bold">LOGIN</span>
</div>
<div class="vms-form-title-bottom-border"></div>
<div class="vms-form-inner">
<form>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<br>
<button type="submit">
<div class="vms-form-submit">LOGIN <span>✔</span></div>
</button>
> Forgot Password ? Reset
</form>
</div>
</div>
<div class="vms-form-footer">
<a href="#!">
<img src="../images/vms/icon-vms-form-footer.png">
> or create an account
</a>
</div>
</div>
</div>
EXPECTED OUTPUT IN ALL SCREENS :
Try it by giving the login button a width attribute just like with the inputs.
Also style the button directly instead of putting a styled div inside.
.vms-form-container {
margin: 0 auto;
}
.vms-form-container a {
text-decoration: none;
}
.vms-form-footer a:hover {
color: white;
}
.vms-form-footer a:visited {
color: white;
}
.vms-form {
text-align: center;
border: 1px solid #a68888;
padding: 9% 17% 8% 17%;
font-family: Arial;
}
.vms-form-footer {
text-align: center;
padding: 7% 17% 7% 17%;
background-color: rgb(37, 80, 87);
color: white;
}
.vms-form-inner {
margin-top: 37px;
}
.vms-form-inner input {
display: block;
margin: 0 auto;
padding: 7px;
width: 73%;
margin-bottom: 15px;
border: 1px solid #d6cfcf;
box-sizing: border-box;
}
.vms-form-inner input:focus {
border: 1px solid rgb(221, 129, 126);
}
.vms-form-inner .vms-form-submit {
background-color: rgb(199, 109, 106);
display: inline-block;
padding: 7px;
width: 73%;
color: white;
border-radius: 2px;
border: none;
position: relative;
}
.vms-form-inner .vms-form-submit span {
position: absolute;
top: 2px;
right: 2px;
bottom: 2px;
width: 14px;
display: block;
background-color: rgb(184, 98, 95);
padding: 5px 11px 5px 11px;
border-radius: 2px;
}
.vms-form-inner a {
text-align: right;
display: block;
width: 342px;
font-size: 12px;
}
.vms-form-title {
font-size: 175%;
color: #483535;
letter-spacing: 2.5px;
margin-bottom: 10px;
}
.vms-form-title-bold {
font-weight: bold;
}
.vms-form-title-bottom-border {
width: 80px;
height: 1px;
margin: 0px auto;
border-bottom: 2px solid #483535;
}
<!-- VMS Form -->
<div class="vms-form-container col-sm-8">
<div class="vms-form">
<div class="vms-form-title">
VENUE <span class="vms-form-title-bold">LOGIN</span>
</div>
<div class="vms-form-title-bottom-border"></div>
<div class="vms-form-inner">
<form>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<br>
<button type="submit" class="vms-form-submit">
LOGIN
<span>✔</span></div>
</button>
> Forgot Password ? Reset
</form>
</div>
</div>
<div class="vms-form-footer">
<a href="#!">
<img src="../images/vms/icon-vms-form-footer.png">
> or create an account
</a>
</div>
</div>

Switching my element to "position: absolute" prevents it form taking up full width

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>

Website Issues - cant find the solutions

First of all i dont know if its permited more than one question in one topic, however i didnt find anything talking about that.
I have been developing a website, but im a bit new to this and my site has some things that need to be worked out, i will be listing the issues bellow and hopefully someone will help me.
1- Slideshow
How i can put the circles (bullet navigation) of the slideshow inside the slideshow ?
Images are not fully the size as the screen, i can see the current slide and a bit of the next slide, what do i do ?
2- Last 2 pages, Mobile & Contacts
If i change
.mobile {
min-width: 1100px;
}
to:
.mobile {
min-width: 1300px;
}
The mobile div will not make text stay on top of the image but the contacts page will not be as responsive as before, just try by yourself.
Thats it, it may simple, but i cant figure it out, i hope theres no problem with this topic, if so tell me.
See it live: http://optential.co.nf/
html,
body { height: 100%; }
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);
background-size: cover;
color: white;
height: 100%;
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 {
box-shadow: 10px 6px 15px grey;
background-color: white;
background-image: url("img/barra.png");
background-position: 12% 0%;
height: 100px;
background-repeat: no-repeat;
text-align: right;
}
#btn {
width: 10em;
}
.mail2.fixed {
box-shadow: 10px 6px 15px grey;
position: fixed;
display:block;
top: 0; left: 0;
width: 100%;
min-width: 800px;
height: 100px;
z-index: 1;
}
.mail2 form {
display: inline-block;
margin: 30px 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);
}
#slider {
width: 100%;
height: 100%;
overflow: hidden;
}
#slider .images {
width: 100%;
position: relative;
transition: left 1s;
left: 0;
}
#slider .images img {
z-index: -1;
width: 100%;
background-size: 100%;
position: absolute;
}
.controls {
width: 350px;
margin: 5px auto;
display: flex;
justify-content: center;
}
.controls div {
width: 16px;
height: 16px;
margin: 0 5px;
background: tomato;
border-radius: 50%;
}
.controls .current {
background: red;
}
.mobile {
min-width: 1300px;
}
.mobile .bar {
background-size: cover;
width: 100%;
background: #F4F4F4;
color: #595B61;
min-width: 700px;
display: flex;
justify-content: space-around;
text-align: center;
}
.mobile .bar img {
width: 100%;
background-size: cover;
display: block;
margin: 0 auto;
}
.mobile .content {
background: radial-gradient(ellipse at 55% 50%, #F9F9F9 40%,#B6B5BD 120%);
position: relative;
}
.mobile .content .mobimg {
padding: 3em;
margin-left:10%;
}
.mobile .content .mob {
position: absolute;
top: 0;
left: 60%;
}
.mobile .content h1 {
color: #D6D6D4;
font-size: 120px;
margin-bottom: 0;
}
.mobile .content p {
margin-left: 15px;
width: 410px;
color: #929584;
font-size: 12px;
margin-bottom: 18px
}
.mobile .content .sep {
height: 15px;
border-bottom: 1px solid #C24147;
text-align: center;
}
.mobile .content .sep img {
padding: 0 8px;
background: #F9F9F9;
}
.mobile .content h2 {
margin-left: 15px;
color: #929584;
font-size: 15px;
font-weight: 600;
text-align: center;
}
.mobile .content .buttons {
display: flex;
justify-content: space-around;
width: 400px;
margin-left: 20px;
}
.mobile .content .button {
display: block;
background: #010101;
color: #F8F8F8;
text-decoration: none;
width: 160px;
height: 50px;
border-radius: 6px;
position: relative;
}
.mobile .content .button:hover {
background: #222;
}
.mobile .content .button.apple img {
margin: 10px 0 0 10px;
}
.mobile .content .button.apple span {
font-size: 11px;
font-weight: 400;
position: absolute;
top: 4px; left: 42px;
}
.mobile .content .button.apple h3 {
font-size: 22px;
font-weight: 600;
position: absolute;
top: 14px; left: 42px;
margin: 0;
}
.mobile .content .button.google img {
margin: 18px 0 0 8px;
}
.mobile .content .button.google span {
font-size: 10px;
font-weight: 600;
position: absolute;
top: 4px; left: 40px;
text-transform: uppercase;
}
.mobile .content .button.google h3 {
font-size: 20px;
font-weight: 300;
position: absolute;
top: 16px; left: 38px;
margin: 0;
}
.mobile .content .button.google h3 b {
font-size: 22px;
font-weight: 400;
font-family: 'Cardo', serif;
margin: 0;
margin-right: 4px
}
.contact {
min-width: 1100px;
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 #btn {
display: inline-block;
color: white;
font-weight: bold;
text-align: center;
text-decoration: none;
background-color: rgb(204, 66, 63);
border-radius: 4px;
padding: 10px 0px;
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="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/fixedbar.js"></script>
<script src="js/slider.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 action="form/form.php" method="post">
<h1>Try Now!</h1>
<input name="Email" class="Email" type="text" placeholder="Enter your Email address ...">
<input type="submit" value="Get started for free">
</form>
</div>
</div>
<div class="mail2">
<form action="form/form.php" method="post">
<h1>Try Now!</h1>
<input type="text" placeholder="Your Email here...">
<input type="submit" id ="btn" value="Get started for free">
<a class="top" href="#top">Top</a>
</form>
</div>
<div id="slider">
<div class="images">
<div class="controls">
<img src="img/3.png" alt="Image-1" />
<img src="img/2.png" alt="Image-2" />
<img src="img/1.png" alt="Image-3" />
<img src="img/4.png" alt="Image-4" />
</div>
</div>
</div>
<div class="mobile">
<div class="bar">
<img src="img/barra2.png">
</div>
<div class="content">
<img class="mobimg" src="https://jsbin-user-assets.s3.amazonaws.com/rafaelcastrocouto/mob.png">
<div class="mob">
<h1>Mobile</h1>
<p>Optential combines the best of responsive software with native IOS and Android apps to provide the best experience and optimal results!</p>
<p>On laptops, desktops, tablets and phones, always get the best experience on the most intuitive project management set of tools in the world!</p>
<p class="sep">
<img src="https://jsbin-user-assets.s3.amazonaws.com/rafaelcastrocouto/a1.png">
</p>
<h2>Get the app!</h2>
<div class="buttons">
<a class="button apple" href="">
<img src="https://jsbin-user-assets.s3.amazonaws.com/rafaelcastrocouto/apple.png">
<span>Download on the</span>
<h3>App Store</h3>
</a>
<a class="button google" href="">
<img src="https://jsbin-user-assets.s3.amazonaws.com/rafaelcastrocouto/google.png">
<span>Get it on</span>
<h3><b>Google</b>play</h3>
</a>
</div>
</div>
</div>
</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 method="POST" id="contactos_form" action="form/contactengine.php" onsubmit="return submit_form(this);">
<div class="col1">
<h1>Contact us!</h1>
<input type="text" name="Name" size="50" placeholder="Name"/>
<input type="text" name="Email" size="50" placeholder="Email"/>
<input type="text" name="Subject" size="50" placeholder="Subject"/>
</div>
<div class="col2">
<textarea name="Message" rows="5" cols="70" placeholder="Message..."></textarea>
<input type="submit" id="btn"value="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>
<script src="js/slider.js"></script>
<script>
function submit_form(form){
formulario=$("#contactos_form");
$.ajax({url: formulario.attr("action"), method:formulario.attr("method"), data:formulario.serialize(), success: function(result){
alert(result);
}});
return false;
}
</script>
</body>
</html>
The css of the slideshow is "slider" and "controls".
Hope someone can help.
To answer questions 1
I will be answering the others shortly. To move the button controls first we need to give them a div, however as the controls are being dynamically generated so we have to edit the code which creates them, to do this we go into slider.js and add class="button move" to the
$('#slider .images img').each(function(i) {
var img = $(this);
img.css('left', i * width);
var button = $('<div class="buttonmove">');
controls.append(button);
if (i == 0) {
button.addClass('current')
}
Now we have something that we can edit, the most easiest way to move them is to use position:relative and give them a -100 top value like so.
.buttonmove {
position: relative;
top: -250px;
}
Question 2
Unfortantly I don't see the issue with your question as changing it 1300px works better as the layer don't overlap, please let me know in more detail;
A- the problem
B- what the result should be like
I hope this helped!
EDIT
Here is the jQuery function;
$(document).ready(function() {
var sliderImgH = $(".sliderimages:first").height();
$(".buttonmove:nth-child(1)").css("margin-top", sliderImgH-75);
});
$(window).resize(function() {
var sliderImgH = $(".sliderimages").height();
$(".buttonmove:nth-child(1)").css("margin-top", sliderImgH-75);
});
I also added this CSS;
.buttonmove {
position: relative;
}
#slider {
position: absolute;
}
*NOTE**
Adjust your function order so it goes or it won't work on load,
<script src="js/slider.js"></script>
Then the function I just made
<script src="js/fixedbar.js"></script>
EDIT(sorry forgot to add...)
I forgot to tell you to to add a class called sliderimages to your first or all of the images in your slider.
<div id="slider">
<div class="images">
<div class="controls">
<img class="sliderimages" src="img/3.png" alt="Image-1" />
<img src="img/2.png" alt="Image-2" />
<img src="img/1.png" alt="Image-3" />
<img src="img/4.png" alt="Image-4" />
</div>
</div>
</div>