Question:medium

Write the complete HTML code to design a "Feedback Form" as shown here, according to the specifications given below:

I. Background Color: The page background should be "Pink".
II. Heading: "Customer Feedback" in the largest heading tag, center-aligned.
III. Form Elements:
  • Name: A Text box to accept the user's name.
  • Service Rating: Two Radio buttons with labels "Good" and "Bad".
  • City: A List box, showing four city names.

Show Hint

Everything sits inside the form tag: an input of type text, two inputs of type radio sharing a name, and a select tag with size 4.
Updated On: Nov 3, 2026
Show Solution

Solution and Explanation

Step 1: Read the figure from top to bottom:
The picture has a pink page, then a big heading, then three rows. Row one is a name box, row two is a rating with two choices, and row three is a list of cities. We write the page in the same order, with one paragraph for each row.

Step 2: Start with the page and the heading:
The pink colour goes on the body tag. The heading uses <h1> because it is the largest, and align="center" centres it.
<body>
<h1>Customer Feedback</h1>


Step 3: Write each row of the form inside paragraph tags:
Using <p> for each row keeps the three rows on separate lines, so no <br> is needed between them. We also join each label to its control with <label>, so a click on the word Good selects its radio button. The radio buttons share the name rating, so they work as one group.

Step 4: Make the list box:
A <select> list with four <option> tags holds the cities. The size="4" attribute makes all four visible together, as in the picture.

Step 5: Write the finished code:
<html>
<body>
<h1>Customer Feedback</h1>
<form>
<p>
<label for="nm">Name:</label>
<input type="text" id="nm" name="name">
</p>
<p>
Service Rating:
<input type="radio" id="g" name="rating" value="good"><label for="g">Good</label>
<input type="radio" id="b" name="rating" value="bad"><label for="b">Bad</label>
</p>
<p>
City:<br>
<select name="city" size="4">
<option value="agra">Agra</option>
<option value="delhi">New Delhi</option>
<option value="jaipur">Jaipur</option>
<option value="noida">Noida</option>
</select>
</p>
</form>
</body>
</html>


Step 6: Check against the specifications:
I: the body is pink. II: the heading is h1 and centred. III: there is a text box for Name, two radio buttons labelled Good and Bad, and a list box with four cities. The simpler version using <br> tags in place of paragraphs is equally correct.

Final Answer:
The code gives a pink page with a centred heading and a form with a text box, two radio buttons and a four-city list box. \[ \boxed{\text{Feedback form: pink page, h1, text box, 2 radio buttons, select size 4}} \]
Was this answer helpful?
0