Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


help with div position filter_list
Author
Message
help with div position #1
i want to create a webpage with register form & login form are in parallel, by using float property i achieved that... but the problem is distance between forms..

currently it look like this
https://www.anonfiles.cc/uploads/fe112dc...bf3bd7.png

i want to make it look like this
https://www.anonfiles.cc/uploads/0f4328b...fcf6ec.png


CSS
Code:
#leftContainer {
   float:left;
}

#rightContainer {
float:right;
}

.form input{
    -webkit-transition: all 0.30s ease-in-out;
    -moz-transition: all 0.30s ease-in-out;
    -ms-transition: all 0.30s ease-in-out;
    -o-transition: all 0.30s ease-in-out;
    outline: none;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    background: #fff;
    margin-bottom: 4%;
    border: 1px solid #ccc;
    padding: 3%;
    color: #000;
    font: 95% Arial, Helvetica, sans-serif;
}
.form input:focus{
    box-shadow: 0 0 5px #43D1AF;
    padding: 3%;
    border: 1px solid #43D1AF;
}

.form input[type="submit"],.form input[type="button"]{
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    padding: 3%;
    background: #43D1AF;
    border-bottom: 2px solid #30C29E;
    border-top-style: none;
    border-right-style: none;
    border-left-style: none;    
    color: #fff;
}
.form input[type="submit"]:hover,.form input[type="button"]:hover{
    background: #2EBC99;
}

HTML
Code:
<div class='form'>

<div id="leftContainer">
<h1>Register</h1>
<form action="/register.php" method="POST">
<input name="fname" type="text" placeholder="First Name"><input name="lname" type="text"placeholder="Last Name">
<br><input name="email" type="text" placeholder="Email"><br>
<input name="rollno" type="text" value="0818" placeholder="Enrollment Number"><br>
<input name="pass" type="pass" placeholder="Password"><br><br>
<input type="button" value="SUBMIT" name="register">

</form>
</div>





<div id="rightContainer">
<h1>Login</h1>
<form action="/check.php" method="POST">
<input name="rollno" type="text" value="0818"><br>
<input type="pass" name="pass"><br><br>
<input type="button" name="login" value="SUBMIT">
</form>
</div>
(This post was last modified: 04-18-2017, 06:32 PM by prudruhuph.)

Reply

RE: help with div position #2
If I'm understanding correctly...
https://www.w3schools.com/css/css_margin.asp
Spoiler:
https://www.w3schools.com/css/css_boxmodel.asp
Code:
#rightContainer {
    margin-left: 150px;
    ...
}
(This post was last modified: 04-18-2017, 10:16 PM by m0dem.)

Reply

RE: help with div position #3
You should use Flexbox. You'll have to clean the code up yourself, but this achieves what you want.

Code:
.form {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  width: 50em;
  margin: auto;
}

.vhr {
  width: .2em;
  background-color: #5d5d5d;
}

.form input{
    -webkit-transition: all 0.30s ease-in-out;
    -moz-transition: all 0.30s ease-in-out;
    -ms-transition: all 0.30s ease-in-out;
    -o-transition: all 0.30s ease-in-out;
    outline: none;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    background: #fff;
    margin-bottom: 4%;
    border: 1px solid #ccc;
    padding: 3%;
    color: #000;
    font: 95% Arial, Helvetica, sans-serif;
}
.form input:focus{
    box-shadow: 0 0 5px #43D1AF;
    padding: 3%;
    border: 1px solid #43D1AF;
}

.form input[type="submit"],.form input[type="button"]{
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    width: 100%;
    padding: 3%;
    background: #43D1AF;
    border-bottom: 2px solid #30C29E;
    border-top-style: none;
    border-right-style: none;
    border-left-style: none;    
    color: #fff;
}
.form input[type="submit"]:hover,.form input[type="button"]:hover{
    background: #2EBC99;
}

Code:
<link rel="stylesheet" href="index.css">

<div class="form">

    <div>
        <h1>Register</h1>
        <form action="/register.php" method="POST">
            <input name="fname" type="text" placeholder="First Name"><input name="lname" type="text"placeholder="Last Name">
            <br>
            <input name="email" type="text" placeholder="Email">
            <br>
            <input name="rollno" type="text" value="0818" placeholder="Enrollment Number">
            <br>
            <input name="pass" type="pass" placeholder="Password">
            <br>
            <br>
            <input type="button" value="SUBMIT" name="register">
        </form>
    </div>
    <div class="vhr">
    </div>
    <div>
        <h1>Login</h1>
        <form action="/check.php" method="POST">
            <input name="rollno" type="text" value="0818"><br>
            <input type="pass" name="pass"><br><br>
            <input type="button" name="login" value="SUBMIT">
        </form>
    </div>
</div>
this forum is dead

Reply

RE: help with div position #4
(04-20-2017, 03:24 AM)Hoss Wrote: You should use Flexbox. You'll have to clean the code up yourself, but this achieves what you want.

Code:
.form {
 display: flex;
 flex-flow: row wrap;
 justify-content: space-around;
 width: 50em;
 margin: auto;
}

.vhr {
 width: .2em;
 background-color: #5d5d5d;
}

.form input{
   -webkit-transition: all 0.30s ease-in-out;
   -moz-transition: all 0.30s ease-in-out;
   -ms-transition: all 0.30s ease-in-out;
   -o-transition: all 0.30s ease-in-out;
   outline: none;
   box-sizing: border-box;
   -webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
   width: 100%;
   background: #fff;
   margin-bottom: 4%;
   border: 1px solid #ccc;
   padding: 3%;
   color: #000;
   font: 95% Arial, Helvetica, sans-serif;
}
.form input:focus{
   box-shadow: 0 0 5px #43D1AF;
   padding: 3%;
   border: 1px solid #43D1AF;
}

.form input[type="submit"],.form input[type="button"]{
   box-sizing: border-box;
   -webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
   width: 100%;
   padding: 3%;
   background: #43D1AF;
   border-bottom: 2px solid #30C29E;
   border-top-style: none;
   border-right-style: none;
   border-left-style: none;    
   color: #fff;
}
.form input[type="submit"]:hover,.form input[type="button"]:hover{
   background: #2EBC99;
}

Code:
<link rel="stylesheet" href="index.css">

<div class="form">

<div>
<h1>Register</h1>
<form action="/register.php" method="POST">
<input name="fname" type="text" placeholder="First Name"><input name="lname" type="text"placeholder="Last Name">
<br>
<input name="email" type="text" placeholder="Email">
<br>
<input name="rollno" type="text" value="0818" placeholder="Enrollment Number">
<br>
<input name="pass" type="pass" placeholder="Password">
<br>
<br>
<input type="button" value="SUBMIT" name="register">
</form>
</div>
<div class="vhr">
</div>
<div>
<h1>Login</h1>
<form action="/check.php" method="POST">
<input name="rollno" type="text" value="0818"><br>
<input type="pass" name="pass"><br><br>
<input type="button" name="login" value="SUBMIT">
</form>
</div>
</div>

Careful with flexbox. It's technically stable, but very far from cross-compatible. Your best (ie9-compatible) bet would be to use a wrapper div that fills its parent, then center the form inside it with margins.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

[+] 1 user Likes Inori's post
Reply

RE: help with div position #5
(04-20-2017, 04:02 AM)Inori Wrote: Careful with flexbox. It's technically stable, but very far from cross-compatible. Your best (ie9-compatible) bet would be to use a wrapper div that fills its parent, then center the form inside it with margins.

I bring with me, a solution for this aswell.

Code:
<script>
document.addEventListener('DOMContentLoaded', function() {
    if ((navigator.userAgent.indexOf('MSIE') + navigator.userAgent.indexOf('Trident')) != -2) {
        document.write('FUCK OFF');
    }
});
</script>
(This post was last modified: 04-20-2017, 04:16 AM by Hoss.)
this forum is dead

[+] 2 users Like Hoss's post
Reply







Users browsing this thread: 1 Guest(s)