Longer Text

A text input has only one line, which is too little for a longer message. For text that can have several lines, we use the textarea element (a text area).

Unlike input, textarea has a closing tag. Whatever we write between the tags appears in the box as pre-filled text, so for an empty box, we write the closing tag right after the opening one. The rows attribute sets how many lines of text the box shows; the user can still write more.

<label for="input-message">Message</label>
<textarea name="message" id="input-message" rows="3"></textarea>

This code is displayed like this:

Instructions

In the empty div, create a textarea element with the attribute name with the value about and the attribute id with the value input-about.

Add the attribute rows with the value 4 to the textarea, so that the box shows four lines.

Before the textarea, create a label with the content About me and the attribute for with the value input-about.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

8/11