Javascript required
Skip to content Skip to sidebar Skip to footer

Hide Header and Footer in Login Page Angualr 6 Updated FREE

Hide Header and Footer in Login Page Angualr 6

How TO - Login Form


Learn how to create a responsive login form with CSS.


Click on the button to open the login form:

× Avatar

Try it Yourself »


How To Create a Login Form

Pace 1) Add HTML:

Add an epitome inside a container and add inputs (with a matching label) for each field. Wrap a <course> element around them to process the input. You tin learn more than about how to process input in our PHP tutorial.

Case

<class activity="action_page.php" method="post">
  <div class="imgcontainer">
    <img src="img_avatar2.png" alt="Avatar" class="avatar">
  </div>

  <div course="container">
    <characterization for="uname"><b>Username</b></characterization>
    <input type="text" placeholder="Enter Username" name="uname" required>

    <label for="psw"><b>Countersign</b></characterization>
    <input type="countersign" placeholder="Enter Password" proper noun="psw" required>

    <push type="submit">Login</push button>
    <label>
      <input type="checkbox" checked="checked" name="remember"> Remember me
    </label>
  </div>

  <div class="container" way="background-color:#f1f1f1">
    <button type="button" form="cancelbtn">Cancel</button>
    <span class="psw">Forgot <a href="#">password?</a></span>
  </div>
</form>



Step 2) Add CSS:

Example

/* Bordered grade */
course {
  edge: 3px solid #f1f1f1;
}

/* Full-width inputs */
input[type=text], input[type=password] {
  width: 100%;
  padding: 12px 20px;
margin: 8px 0;
display: inline-block;
  border: 1px solid #ccc;
  box-sizing: edge-box;
}

/* Set a fashion for all buttons */
button {
  background-colour: #04AA6D;
color: white;
  padding: 14px 20px;
  margin: 8px 0;
  edge: none;
  cursor: pointer;
width: 100%;
}

/* Add a hover issue for buttons */
button:hover {
  opacity: 0.8;
}

/* Extra style for the cancel button (red) */
.cancelbtn {
  width: automobile;
  padding: 10px 18px;
background-colour: #f44336;
}

/* Eye the avatar epitome inside this container */
.imgcontainer {
  text-marshal: center;
  margin: 24px 0 12px 0;
}

/* Avatar image */
img.avatar {
  width: forty%;
border-radius: fifty%;
}

/* Add padding to containers */
.container {
padding: 16px;
}

/* The "Forgot password" text */
span.psw {
  bladder: correct;
  padding-pinnacle: 16px;
}

/* Change styles for span and cancel button on extra pocket-size screens */
@media screen and (max-width: 300px) {
  span.psw {
    display: cake;
    float: none;
  }
  .cancelbtn {
width: 100%;
  }
}

Endeavor information technology Yourself »


How To Create a Modal Login Form

Step 1) Add HTML:

Example

<!-- Button to open up the modal login grade -->
<button onclick="document.getElementById('id01').style.brandish='cake'">Login</push>

<!-- The Modal -->
<div id="id01" class="modal">
  <span onclick="document.getElementById('id01').style.brandish='none'"
class="shut" title="Close Modal">&times;</span>

  <!-- Modal Content -->
  <form course="modal-content animate" activeness="/action_page.php">
    <div class="imgcontainer">
      <img src="img_avatar2.png" alt="Avatar" class="avatar">
    </div>

    <div grade="container">
      <characterization for="uname"><b>Username</b></label>
      <input type="text" placeholder="Enter Username" name="uname" required>

      <label for="psw"><b>Password</b></label>
      <input blazon="password" placeholder="Enter Password" proper name="psw" required>

      <button type="submit">Login</button>
      <label>
        <input type="checkbox" checked="checked" name="remember"> Remember me
      </label>
    </div>

    <div class="container" manner="background-color:#f1f1f1">
      <button type="button" onclick="document.getElementById('id01').style.display='none'" grade="cancelbtn">Cancel</button>
      <span class="psw">Forgot <a href="#">countersign?</a></span>
    </div>
  </grade>
</div>


Step 2) Add CSS:

Example

/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: stock-still; /* Stay in place */
  z-index: ane; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  elevation: 100%; /* Full superlative */
  overflow: auto; /* Enable curlicue if needed */
  background-color: rgb(0,0,0); /* Fallback colour */
  groundwork-color: rgba(0,0,0,0.four); /* Black westward/ opacity */
  padding-pinnacle: 60px;
}

/* Modal Content/Box */
.modal-content {
  groundwork-color: #fefefe;
  margin: 5px auto; /* 15% from the elevation and centered */
  border: 1px solid #888;
  width: eighty%; /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close {
  /* Position information technology in the top right corner outside of the modal */
  position: absolute;
  right: 25px;
  pinnacle: 0;
  colour: #000;
  font-size: 35px;
  font-weight: bold;
}

/* Shut button on hover */
.close:hover,
.close:focus {
  color: red;
  cursor: pointer;
}

/* Add together Zoom Animation */
.animate {
  -webkit-animation: animatezoom 0.6s;
  blitheness: animatezoom 0.6s
}

@-webkit-keyframes animatezoom {
  from {-webkit-transform: scale(0)}
  to {-webkit-transform: calibration(ane)}
}

@keyframes animatezoom {
  from {transform: scale(0)}
  to {transform: scale(1)}
}

Tip: You tin also use the post-obit javascript to close the modal past clicking outside of the modal content (and non just by using the "x" or "cancel" button to shut it):

Instance

<script>
// Become the modal
var modal = document.getElementById('id01');

// When the user clicks anywhere outside of the modal, close it
window.onclick = function(effect) {
  if (event.target == modal) {
    modal.style.display = "none";
  }
}
</script>

Attempt it Yourself »

Tip: Go to our HTML Form Tutorial to learn more about HTML Forms.

Tip: Get to our CSS Course Tutorial to learn more near how to way form elements.

Ever heard about W3Schools Spaces? Here you can create your website from scratch or apply a template, and host information technology for free.

Become started for free ❯

* no credit bill of fare required


Hide Header and Footer in Login Page Angualr 6

DOWNLOAD HERE

Source: https://www.w3schools.com/howto/howto_css_login_form.asp

Posted by: kelleygodiever.blogspot.com