4.11. Introduction to HTML: basic structure, tags and attributes: Input tags
Page 15 | Listen in audio
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.
Next page of the Free Ebook: