The HTML <section> tag is used to represent a section within an article. any given web page or article could have many sections.
For example, a homepage could have a section for introducing the company, another section for news items, and another section for contact information.
The <section> tag was introduced in HTML 5.
The following example demonstrates usage of the <section> tag.
<!DOCTYPE html> <html> <head> <title>HTML Section Tag</title> </head> <body> <section> <h1>Tutorial</h1> <h2>Html5</h2> <p>HTML 5 is a markup language used for structuring and presenting content on the World Wide Web.</p> </section> </body> </html>
HTML 5 is a markup language used for structuring and presenting content on the World Wide Web.
HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave.
Attributes consist of a name and a value separated by an equals (=) sign, with the value surrounded by double quotes. Here's an example,
There are 3 kinds of attributes that you can add to your HTML tags: Element-specific, global, and event handler content attributes.
The attributes that you can add to this tag are listed below.
Event Handler Content Attributes