Introduction to HTML: Basic structure, tags and attributes: Input tags

Introduction to HTML

HTML, which stands for HyperText Markup Language, is the standard markup language for creating web pages. HTML describes the structure of a web page and consists of a series of elements. HTML provides the basic structure of the page, on top of which layers of style and behavior are added.

Basic structure of HTML

An HTML document begins with the document type . The HTML document itself starts with the tag and ends with . The visible content of the web page is enclosed between and .

<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>

The page content goes here...

</body>
</html>

HTML Tags and Attributes

HTML elements are defined by tags, surrounded by angle brackets. HTML tags are usually in pairs like <h1> and </h1>, but some represent empty elements and are incomplete, like <img>< /b>. HTML attributes provide additional information about elements. They always come in name/value pairs, like: name="value".

Input tags

The input tag is one of the most important elements of HTML for user interaction. The tag can be displayed in several ways depending on the attribute type.

<input type="text"> 
<input type="radio"> 
<input type="submit"> 

Some of the most common attributes that accompany the input tag include the 'value' attribute, which defines the initial value of the control, and the 'name' attribute, which defines the name of the control.

<input type="text" value="Name">
<input type="radio" name="genre">

Conclusion

HTML is an essential markup language for any web developer. It provides the basic structure of the page, which is then enhanced with CSS for style and JavaScript for behavior. Understanding the basic structure of HTML, tags and attributes, especially the input tag, is critical to creating interactive and dynamic web pages.

Note: This is just an example of how an HTML document is structured. In practice, you will probably have many more tags to format your content. Also, remember that it is good practice to always close your HTML tags to avoid any possible browser confusion.

Now answer the exercise about the content:

According to the text, which of the following statements is true about HTML?

You are right! Congratulations, now go to the next page

You missed! Try again.

Article image Introduction to HTML: basic structure, tags and attributes: Button tags 16

Next page of the Free Ebook:

Introduction to HTML: basic structure, tags and attributes: Button tags

Estimated reading time: 5 minutes

Download the app to earn free Certification and listen to the courses in the background, even with the screen off.
  • Read this course in the app to earn your Digital Certificate!
  • Listen to this course in the app without having to turn on your cell phone screen;
  • Get 100% free access to more than 4000 online courses, ebooks and audiobooks;
  • + Hundreds of exercises + Educational Stories.

+ 9 million
students

Free and Valid
Certificate

60 thousand free
exercises

4.8/5 rating in
app stores

Free courses in
video and ebooks