HTML Code:
<!DOCTYPE html><!-- Declares the document type and version of HTML -->
<html>
<head>
<meta charset="utf-8"><!-- Specifies the character encoding for the document -->
<title>How to define a caption for a fieldset element</title><!-- Sets the title of the document -->
</head>
<body>
<form><!-- Begins a form element -->
<fieldset><!-- Begins a fieldset element -->
<legend>Cariculam-vita:</legend><!-- Defines a caption for the fieldset -->
Name: <input type="text"><br><!-- Creates a text input field for entering the name -->
Address: <input type="text"><br><!-- Creates a text input field for entering the address -->
Phone No: <input type="text"><br><!-- Creates a text input field for entering the phone number -->
Email: <input type="text"><!-- Creates a text input field for entering the email -->
</fieldset><!-- Ends the fieldset element -->
</form><!-- Ends the form element -->
</body>
</html>
Explanation:
Live Demo :
See the Pen legend-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4