EllisJ98
EllisJ98

Reputation: 23

CSS form not applying

I have this form:

<div class="jumbotron" id="jumbotron-6" align="center">        
    <form action="login.php" method="POST">
      <input type="text" placeholder="Enter your email" name="email"> 
        <input type="password" placeholder="and password" name="password">
        <input type="submit">
    </form> 
</div>  

And I am trying to apply this CSS to it:

input [type="text"], input [type="password"] {
  outline: none;
  padding: 10px;
  display: block;
  width: 300px;
  border-radius: 3px;
  border:1px solid #eee;
  margin:20px auto;
}

But it is not applying. I have my css linked up to the page too.

Upvotes: 1

Views: 58

Answers (2)

Yasin Yaqoobi
Yasin Yaqoobi

Reputation: 2040

Remove the spacing so it would be input[....]

input[type="text"], input[type="password"] {
  outline: none;
  padding: 10px;
  display: block;
  width: 300px;
  border-radius: 3px;
  border:1px solid #eee;
  margin:20px auto;
}
<div class="jumbotron" id="jumbotron-6" align="center">        
    <form action="login.php" method="POST">
      <input type="text" placeholder="Enter your email" name="email"> 
        <input type="password" placeholder="and password" name="password">
        <input type="submit">
    </form> 
</div>  

Upvotes: 3

C3roe
C3roe

Reputation: 96316

input [type="text"], input [type="password"] {

That would select elements inside an input element (impossible in HTML) that have a type of text or password - you need to remove the spaces, to select input elements that themsleves are of type text or password:

input[type="text"], input[type="password"] {

Upvotes: 1

Related Questions