Simple css jquery modal

Hi
my name is frank, as a homework, I need to make a modal in html, css, jquery. I have done it but as I click on the button, the launched modal is not positioned properly however I tried it…also label is not positioned properly and I need to link it to the input field. please help me.thank you.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
.button {
  background-color: #4CAF50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}
/*modal*/

	.bg-modal{
	    position:relative;
		width:100%;
		height:100%;
		background-color:rgba(0,0,0,0.6);
		position:absolute;
		display:flex;
		justify-content:center;
		align-items:center;

	}
	.Modal-content{
		position:relative;		
	    width: 480px;
		height:340px;
		margin: auto;
		background-color:white;
		text-align:center;
		padding:10px;
		margin-left:15px;
		margin-right:15px;
	}
	form{
		position:absolute;
	    top:80px;
		width:100%;
	}
	input{
	   	width:80%;
		height:28px;
		display:block;
		margin:20px auto;
		
	}
	.close{
		position:absolute;
		top:16px;
		right:16px;
		font-size:42px;
		transform:rotate(45deg);
		cursor:pointer;
	}
	form label{
	    position:relative;
		margin-left:-320px;
		
	}
	a {
		  background-color: #4CAF50;
		  border: none;
		  color: white;
		  padding: 15px 32px;
		  text-align: center;
		  text-decoration: none;
		  display: inline-block;
		  font-size: 16px;
		  margin: 4px 2px;
		  cursor: pointer;
	}	  
</style>
</head>Ad for DataStax
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<button class="button btn2">Green</button>
<div class="bg-modal">
	<div class="Modal-content">
	<div class="close">+</div>
			<form action="">
			    
				<label>E=mail</label>
				<input type="text" placeholder="E=mail"></label>
				<label>Password</label>
				<input type="text" placeholder="Password">
				<a class"button" href="">Submit</a>
			</form>
	
	</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $(".close").click(function(){
    $(".bg-modal").hide();
  });
  $(".btn2").click(function(){
    $(".bg-modal").show();
  });
});
</script>

<body>
</body>
</html>

Something like this:

.button {
  background-color: #4caf50;
  /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}

/*modal*/

.bg-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.Modal-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 480px;
  height: 340px;
  margin: auto;
  background-color: white;
  text-align: center;
  padding: 10px;
  margin-left: 15px;
  margin-right: 15px;
}

.Modal-content form {
  flex: 1 0 100%;
}

.Modal-content input {
  width: 80%;
  height: 28px;
  display: block;
  margin: 20px auto;
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 42px;
  transform: rotate(45deg);
  cursor: pointer;
}

.Modal-content  label {
  position: relative;
  text-align: left;
  display: block;
  width: 80%;
  margin: auto;
}

a {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}

Add an id to the input and a for attribute to the label with a value of the id.

<label for="Password">Password</label>
<input id="Password" type="text" placeholder="Password">

I forgot happy new year.
thank you for help.it is really nice. taking it farther, I tried to apply a forgot password thing from my previous experiment but it is not working. I thing something is different I don’t see at the moment.
this is the new code, please have a look. also I tried display:block;for the text for changings, not working

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
	.button {
		  background-color: #4CAF50; /* Green */
		  border: none;
		  color: white;
		  padding: 15px 32px;
		  text-align: center;
		  text-decoration: none;
		  display: inline-block;
		  font-size: 16px;
		  margin: 4px 2px;
		  cursor: pointer;
		}
	/*modal*/

	.bg-modal{
	    position:relative;
		width:100%;
		height:100%;
		background-color:rgba(0,0,0,0.3);
		position:absolute;
		display:flex;
		justify-content:center;
		align-items:center;

	}
	.Modal-content {
		  display: flex;
		  justify-content: center;
		  align-items: center;
		  position: relative;
		  width: 480px;
		  height: 340px;
		  margin: auto;
		  background-color: white;
		  text-align: center;
		  padding: 10px;
		  margin-left: 15px;
		  margin-right: 15px;
		}
	.Modal-content form {
		  flex: 1 0 100%;
		}

	.Modal-content input {
		  width: 80%;
		  height: 28px;
		  display: block;
		  margin: 20px auto;
		}
	Modal-content .span_alter {
		display: inline-block;
	}	
	.close{
		position:absolute;
		top:16px;
		right:16px;
		font-size:42px;
		transform:rotate(45deg);
		cursor:pointer;
	}
	
	.Modal-content  label {
		  position: relative;
		  text-align: left;
		  display: block;
		  width: 80%;
		  margin: auto;
		}

	.btn_a1 {
		  background-color: #4caf50;
		  border: none;
		  color: white;
		  padding: 15px 32px;
		  text-align: center;
		  text-decoration: none;
		  display: inline-block;
		  font-size: 16px;
		  margin: 4px 2px;
		  cursor: pointer;
		} 
	.span-alter .btn_a1{
		float:left;
	}		
</style>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<button class="button btn2">Green</button>
<div class="bg-modal">
	<div class="Modal-content">
	<div class="close">+</div>
		<form id="login2" action="">
			
			<label for="Email">E=mail</label>
            <input id="Email" type="email" placeholder="E-mail">
			
			<label for="Password">Password</label>
			<input id="Password" type="text" placeholder="Password">
			
			<a class="btn_a1" href="">Submit</a>
			<div class="span-alter">
				<span class="">Forgot password ?<a id="resetpw"><b> Change here.</b></a></span>
				<span class="">Not yet member ?<a href=""><b> Register here.</b></a></span>
			</div>	
		</form>
		
		<form id="resetpw" action="">
			
			<label for="Email">E=mail</label>
            <input id="Email" type="email" placeholder="E-mail">
			
			<label for="Password">Password</label>
			<input id="Password" type="text" placeholder="Password">
			
			<a class="btn_a1" href="">Submit</a>
			<div class="span-alter">
				<span class="">Forgot password ?<a id="login2"><b> Login here.</b></a></span>
				<span class="">Not yet member ?<a href=""><b href=""> Register here.</b></a></span>
			</div>	
		</form>
		<div>
		
		</div>
	
	</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>
$(document).ready(function(){
  $(".close").click(function(){
     $(".bg-modal").fadeOut("slow");
     $(".bg-modal").hide();
  });
  $(".btn2").click(function(){
	 $(".bg-modal").fadeIn("slow");
     $(".bg-modal").show();
  });

	
		$("#resetpw").on("click", function(){
			$("#login2").css("display","none");
		    $("#resetpw").css("display","inline");
			e.preventDefault();
		});
		
		$("#login2").on("click", function(){
			$("#login2").css("display","inline");
		    $("#resetpw").css("display","none");
			e.preventDefault();
		});
	});
 </script>
<body>
</body>
</html>

I’m finished for the night now and will take look tomorrow :slight_smile:

Belated happy new year to you also.

I’m not sure what you are attempting to do there as you have the same thing twice.

If you can explain what its supposed to look like and how it works then I may be able to offer a suggestion.

I do notice that you did not add the fixed positioning I gave you to the modal. A modal is of no use if it doesn’t sit on top of everything and if it doesn’t scroll away with the document. You should not be able to interact with anything apart from what is in the modal.

Hi Paul
thank you for answer. as I mentioned, I’ve done similar but this one is not working. by default meaning the password reset should be hidden and able to switch. also the switch part supposed to stay under the submit button. first forgot password then not yet member. thank you.

You are using the same id twice. Once to trigger the swap and once for the name of the form. Ids must be unique. Use a different id for the js click action from the name of the form.

e.g.

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<button class="button btn2">Green</button>
<div class="bg-modal">
  <div class="Modal-content">
    <div class="close">+</div>
    <form id="login2" action="">

      <label for="Email">E=mail</label>
      <input id="Email" type="email" placeholder="E-mail">

      <label for="Password">Password</label>
      <input id="Password" type="text" placeholder="Password">

      <a class="btn_a1" href="">Submit</a>
      <div class="span-alter">
        <span class="">Forgot password ?<a id="resetpw"><b> Change here.</b></a></span>
        <span class="">Not yet member ?<a href=""><b> Register here.</b></a></span>
      </div>
    </form>

    <form id="reset-password" action="">
      <label for="Email">E=mail</label>
      <input id="Email" type="email" placeholder="E-mail">

      <label for="Password">Password</label>
      <input id="Password" type="text" placeholder="Password">

      <a class="btn_a1" href="">Submit</a>
      <div class="span-alter">
        <span class="">Forgot password ?<a id="login-main"><b> Login here.</b></a></span>
        <span class="">Not yet member ?<a href=""><b href=""> Register here.</b></a></span>
      </div>
    </form>
  </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>
  $(document).ready(function() {
    $(".close").click(function() {
      $(".bg-modal").fadeOut("slow");
      // $(".bg-modal").hide();
    });
    $(".btn2").click(function() {
      $(".bg-modal").fadeIn("slow");
      //$(".bg-modal").show();
    });
    $("#resetpw").on("click", function() {
      $("#login2").css("display", "none");
      $("#reset-password").css("display", "block");
      e.preventDefault();
    });
    $("#login-main").on("click", function() {
      $("#login2").css("display", "block");
      $("#reset-password").css("display", "none");
      e.preventDefault();
    });
  });
</script>

You would then need to hide the reset password field which can be done in CSS.

 #reset-password {
  display: none;
}

Although I guess you should hide it with js instead of CSS so is available if js is not working.

$("#reset-password").hide();

Don’t forget to change the modal to fixed and set its position otherwise the rules do not make sense.

.bg-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

Revised CSS with above changes:

.button {
  background-color: #4caf50; /* Green */
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}
/*modal*/

.bg-modal {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.Modal-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 480px;
  height: auto;
  margin: auto;
  background-color: white;
  text-align: center;
  padding: 10px;
  margin-left: 15px;
  margin-right: 15px;
  flex-wrap: wrap;
}
.Modal-content form {
  flex: 1 0 100%;
  margin: 20px auto;
}

.Modal-content input {
  width: 80%;
  height: 28px;
  display: block;
  margin: 20px auto;
}
Modal-content .span_alter {
  display: inline-block;
}
.close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 42px;
  transform: rotate(45deg);
  cursor: pointer;
}

.Modal-content label {
  position: relative;
  text-align: left;
  display: block;
  width: 80%;
  margin: auto;
}
.btn_a1 {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}
.span-alter .btn_a1 {
  float: left;
}

HTML changes.

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<button class="button btn2">Green</button>
<div class="bg-modal">
  <div class="Modal-content">
    <div class="close">+</div>
    <form id="login2" action="">

      <label for="Email">E=mail</label>
      <input id="Email" type="email" placeholder="E-mail">

      <label for="Password">Password</label>
      <input id="Password" type="text" placeholder="Password">

      <a class="btn_a1" href="">Submit</a>
      <div class="span-alter">
        <span class="">Forgot password ?<a id="resetpw"><b> Change here.</b></a></span>
        <span class="">Not yet member ?<a href=""><b> Register here.</b></a></span>
      </div>
    </form>

    <form id="reset-password" action="">
      <label for="Email2">E=mail</label>
      <input id="Email2" type="email" placeholder="E-mail">

      <label for="Password2">Password</label>
      <input id="Password2" type="text" placeholder="Password">

      <a class="btn_a1" href="">Submit</a>
      <div class="span-alter">
        <span class="">Forgot password ?<a id="login-main"><b> Login here.</b></a></span>
        <span class="">Not yet member ?<a href=""><b href=""> Register here.</b></a></span>
      </div>
    </form>
  </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>
  $(document).ready(function() {
    $("#reset-password").hide();
    $(".close").click(function() {
      $(".bg-modal").fadeOut("slow");
      // $(".bg-modal").hide();
    });
    $(".btn2").click(function() {
      $(".bg-modal").fadeIn("slow");
      //$(".bg-modal").show();
    });
    $("#resetpw").on("click", function() {
      $("#login2").css("display", "none");
      $("#reset-password").css("display", "block");
      e.preventDefault();
    });
    $("#login-main").on("click", function() {
      $("#login2").css("display", "block");
      $("#reset-password").css("display", "none");
      e.preventDefault();
    });
  });
</script>

Remember ids must be different even in the forms that are shown and hidden.

Hi Paul

thank you for help.It looks better, started working but as I click change password , clicking on register (registration ) it takes back to login as login that not supposed to happen. registration has its own form to be linked.please have a look, thank you.

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<button class="button btn2">Green</button>
<div class="bg-modal">
	<div class="Modal-content">
	<div class="close">+</div>
		<form id="login2" action="">
			
			<label for="Email">E-mail</label>
            <input id="Email" type="email" placeholder="E-mail">
			
			<label for="Password">Password</label>
			<input id="Password" type="text" placeholder="Password">
			
			<a class="btn_a1" href="">Submit</a>
			<div class="span-alter">
				<span class="alter1">Forgot password ?<a id="resetpw"><b> Change here.</b></a></span>
				<span class="alter2">Not yet member ?<a href=""><b> Register here.</b></a></span>
			</div>	
		</form>
		
		<form id="reset-password" action="">
			
			<label for="Email">E-mail</label>
            <input id="Email" type="email" placeholder="E-mail">
			
			<label for="Password">Password</label>
			<input id="Password" type="text" placeholder="Password">
			
			<label for="Passwordre">Password retype</label>
			<input id="Passwordre" type="text" placeholder="Password retype">
			
			<a class="btn_a1" href="">Submit</a>
			<div class="span-alter">
				<span class="alter1">You need to log in ?<a id="login-main"><b> Login here.</b></a></span>
				<span class="alter2">Not yet member ?<a href=""><b> Register here.</b></a></span>
			</div>	
		</form>
		<div>
		
		</div>
	
	</div>
</div>

You don’t have a register form on there. You just have a null link.

<a href=""><b> Register here.</b></a>

I assumed you were linking to a new page so you would need an href to go there.

You still have the same Ids for the second form and that is strictly not allowed and will break everything.

Yes but I dont understand why takes me back to login? not suppoed to. thank you

Because you don’t have a valid link address the link goes back to the top of the page and resets the form. Put a valid href in place and test again.

if I place # can stop taking me back to login?

It should do as an empty href reloads the page but a hash will take you to the top of the page.

However it won’t help your visitor if you don’t send them to the right page.

I just need temporarily, to test my code. here is my new code, please have a look,thank you.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>/*
	.button {
		  background-color: #4CAF50; /* Green */
/*		  border: none;
		  color: white;
		  padding: 15px 32px;
		  text-align: center;
		  text-decoration: none;
		  display: inline-block;
		  font-size: 16px;
		  margin: 4px 2px;
		  cursor: pointer;
		}*/
	/*modal*/

	.bg-modal {
		  position: fixed;
		  top: 0;
		  left: 0;
		  width: 100%;
		  height: 100%;
		  overflow: auto;
		  background-color: rgba(0, 0, 0, 0.6);
		  display: flex;
		  justify-content: center;
		  align-items: center;
		}
	.Modal-content {
		  display: flex;
		  justify-content: center;
		  align-items: center;
		  position: relative;
		  width: 480px;
		  height: 480px;
		  margin: auto;
		  background-color: white;
		  text-align: center;
		  padding: 10px;
		  margin-left: 15px;
		  margin-right: 15px;
		}
	.Modal-content form {
		  flex: 1 0 100%;
		}

	.Modal-content input {
		  width: 80%;
		  height: 28px;
		  display: block;
		  margin: 20px auto;
		}
	Modal-content .span_alter {
		display: inline-block;
	}	
	.close{
		position:absolute;
		top:16px;
		right:16px;
		font-size:42px;
		transform:rotate(45deg);
		cursor:pointer;
	}
	
	.Modal-content  label {
		  position: relative;
		  text-align: left;
		  display: block;
		  width: 80%;
		  margin: auto;
		}

	.btn_a1 {
		  background-color: #4caf50;
		  border: none;
		  color: white;
		  padding: 15px 32px;
		  text-align: center;
		  text-decoration: none;
		  display: inline-block;
		  font-size: 16px;
		  margin: 4px 2px;
		  cursor: pointer;
		} 
	
    .alter1, .alter2 { float:left;}	
	.span-alter, .btn_a1{
		float:left;
	} */
	#reset-password {
	  display: none;
	}*/
	form h2 {
		top:15px;
		padding-left:50%;
		padding-right:50%;
		color:darkred;
	}
	.span-alter{ float:left;}
	form .btn_a1, 
	form .span-alter {left:50px;}
</style>
</head>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>
<button class="button btn2">Green</button>
<div class="bg-modal">
	<div class="Modal-content">
	<div class="close">+</div>
	<h2>Login Modal</h2>
		<form id="login2" action="">
			
			<label for="Email">E-mail</label>
            <input id="Email" type="email" placeholder="E-mail">
			
			<label for="Password">Password</label>
			<input id="Password" type="text" placeholder="Password">
			
			<a class="btn_a1" href="">Submit</a>
			<div class="span-alter">
				<span class="alter1">Forgot password ?<a id="resetpw"><b> Change here.</b></a></span>
				<span class="alter2">Not yet member ?<a href="#"><b> Register here.</b></a></span>
			</div>	
		</form>
		
		<form id="reset-password" action="">
			
			<label for="Email">E-mail</label>
            <input id="Email" type="email" placeholder="E-mail">
			
			<label for="Password">Password</label>
			<input id="Password" type="text" placeholder="Password">
			
			<label for="Passwordre">Password retype</label>
			<input id="Passwordre" type="text" placeholder="Password retype">
			
			<a class="btn_a1" href="">Submit</a>
			<div class="span-alter">
				<span class="alter1">You need to log in ?<a id="login-main"><b> Login here.</b></a></span>
				<span class="alter2">Not yet member ?<a href="#"><b> Register here.</b></a></span>
			</div>	
		</form>
		<div>
		
		</div>
	
	</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>
  $(document).ready(function() {
    $("#reset-password").hide();
    $(".close").click(function() {
      $(".bg-modal").fadeOut("slow");
      // $(".bg-modal").hide();
    });
    $(".btn2").click(function() {
      $(".bg-modal").fadeIn("slow");
      //$(".bg-modal").show();
    });
    $("#resetpw").on("click", function() {
      $("#login2").css("display", "none");
      $("#reset-password").css("display", "block");
      e.preventDefault();
    });
    $("#login-main").on("click", function() {
      $("#login2").css("display", "block");
      $("#reset-password").css("display", "none");
      e.preventDefault();
    });
  });
</script>
<body>
</body>
</html>

You still haven’t changed the ids to be unique.

As you are adding an h2 heading you now have to change the flex direction of the modal or it will line it up sideways with the form.

I removed all the nonsense from the CSS and you are left with this.

/*modal*/

.bg-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.Modal-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 480px;
  height: auto; /* removed height*/
  margin: auto;
  background-color: white;
  text-align: center;
  padding: 10px;
  margin-left: 15px;
  margin-right: 15px;
}

.Modal-content form {
  flex: 1 0 100%;
}

.Modal-content input {
  width: 80%;
  height: 28px;
  display: block;
  margin: 20px auto;
}

.Modal-content .span_alter {
  display: inline-block;
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 42px;
  transform: rotate(45deg);
  cursor: pointer;
}

.Modal-content label {
  position: relative;
  text-align: left;
  display: block;
  width: 80%;
  margin: auto;
}

.btn_a1 {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: table;
  font-size: 16px;
  margin: 4px 2px 10px 40px;
  cursor: pointer;
}

.Modal-content h2 {
  margin: 1rem 0;
  color: darkred;
}

The modal should not have a height as that is a guess and a magic number. let the content dictate the height or use a min-height instead if you have little content.

thank you for help
it work well. I would like to ask another question:

.Modal-content input {
		  width: 80%;
		  height: 28px;
		  display: block;
		  margin: 20px auto;
		  border: none;
		  border-bottom:3px solid green;
		 // background-color:lightgreen;
		  
		}
	.Modal-content input:hover {
		border-bottom:3px solid purple;
	}	
	.Modal-content input:focus {
		border:none;
		
	}

I would like to remove the border that I get clicking on input field.thank you.

It’s not border its an outline and you shouldn’t get rid of it because keyboard users won’t be able to use the form at all. The outline shows that the input is the focus state and is shown when someone tabs through the elements.

You can change the colour or set other properties on focus but you should not have a focus state that isn’t differentiated from a normal state.

The outline property is set like this:

 .Modal-content input:focus {
		border-color:red;/* must have something different to show it is in focus*/
		outline:none;
        background:#f9f9f9;/* or something like this to show it is in focus*/
	}
1 Like

thank you for help. ok I understand it. Is it possible to change the thickness of the frame?
also I would like change/login and registration under submit button like 'display block '. please help me. thank you.

I’m not sure what frame you mean. Can you clarify?

Without knowing how you want it to look that will be difficult. I’m sure you can work out how to change the display to block if that’s what you wanted.

You need to be a bit more specific when you ask for help as it’s hard to second guess :slight_smile:

I mean the border I mentioned previously. to make it’s thickness let say, 1px .change color is good too…thank you.