Warm-Up: Cotton Candy Inputs
Start by opening up this project. It contains a simple HTML page that has a header and two input boxes.
index.html
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Two Inputs</h1>
<input type="text" />
<input type="text" />
</body>
</html>
The goal of this activity is to give one of the boxes a pink background, and the other one an aqua background.
- Open the index.html file for editing
- Add an
idattribute to the first<input>element, and set it topink - Add an
idattribute to the second<input>element, and set it toaqua - Open the style.css file for editing
- Create a new ruleset selecting the
pinkinput by itsid - Within the
#pink { }ruleset, usebackground: pink;to set the background color to pink - Repeat the steps above for a
#aquaruleset - set its background color toaqua
Click the Run button, and make sure the two inputs appear with the proper cotton candy colors!
Challenge
For an additional challenge, create a third input that should have a lavender background color.