Web Development Course:
HTML section: Main Tips
sectiontags surround a generic section of the content in a web page or application.
- They were introduced in HTML5 and support global attributes.
- If you want to group elements to a generic container, use <div> tag instead.
- You must use both opening and ending
Using HTML section Tags
section element, defined by
section tags, defines a section of a document, web page, or an application:
<section> <h1>Section Heading</h1> <p>The section tag can contain any elements.</p> <img src="image.png" alt="section example"> </section>
Elements of a section are similar in theme and thus possible to group together logically. For example, a company's web site might have separate sections for contact information, news, or special offers.
Note: HTML5 section is called a semantic element, because the tag defines its content. Such elements help browsers understand web pages correctly.
Mobile Browser Support
CSS selector guide: what is the difference between CSS parent selector and CSS descendant selectors? Learn all about using CSS selector here.
HTML5 Tags List: Get to Know the Most Useful Elements
Find HTML5 tags explained and illustrated with beginner-friendly HTML5 examples. Grasp the difference between HTML5 tags & elements and learn to use both!