w3resource
HTML exercises

HTML CSS Exercise: Style placeholder text

Solution:

HTML Code :

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>HTML CSS Exercises - Style Placeholder text</title>
<style type="text/css">
input[type="text"]::-webkit-input-placeholder {
  color: orange;
}
</style>
</head>
<body>
//insert this within html section. within body of codepen 
<form action="">
 <div>
    <label for="email">Email:</label>
    <input id="email" name="email" type="text" placeholder="[email protected]">
  </div>
</form>

//insert this within css section. within body of codepen 
</body>
</html>

Live Demo :

See the Pen style-placeholder-text-answer by w3resource (@w3resource) on CodePen.


Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
YesYesYesYesYes

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming