Why don't I get the results I want?

Joined
Nov 11, 2023
Messages
3
Reaction score
0
So I want the password text to be read and I followed the instructsions from my bootcamp, but the text does not change. Please see the attached photos and tell me what I am doing wrong.
 

Attachments

  • 1.png
    1.png
    83.3 KB · Views: 13
  • 2.png
    2.png
    129.8 KB · Views: 14
Joined
Jul 4, 2023
Messages
376
Reaction score
42
Remove the space between the word input and the square bracket.
CSS:
input[type="password"] { ... }
[ full code on-line ]
HTML:
<style>
  label {
    display: inline-block;
    margin-top: 1rem;
  }
  input {
    display: block;
  }

  input[type="password"] {
    color: red;
  }
</style>

<label for="search">Search</label>
<input type="search" id="search" name="search" placeholder="Search ...">

<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Password">
 
Last edited:
Joined
Jul 4, 2023
Messages
376
Reaction score
42
1699720132093.png


You need to set a name (e.g style.css) for the css styles file and in the head (<head> ... </head>) section write like that

HTML:
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lorem</title>
 
    <link rel="stylesheet" href="style.css"><!-- your css style file -->
  </head>
  <body>

    <h1>Lorem</h1>
 
    <p>Lorem ipsum dolment.</p>

  </body>
</html>


1699720922889.png


index.html and style.css must be in the same folder (in this particular case).
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,794
Messages
2,569,641
Members
45,355
Latest member
SJLChristi

Latest Threads

Top