<section> is the new <div>

Todd October 12, 2023
Source
Note that there are times and places to use the div and section elements. This article addresses the need for more accessible solutions and fixes as well as the need to stop overengineering things. There will be cases when repetition is necessary. But with the overengineering I see when I do accessibility audits, and the rendered HTML I see that is choked with unnecessary containers and wrappers and elements that take up space and bytes, this is what this article addresses. Remember when… We used to have tables for layouts? Then we had the trusty div element and it took off like a rocket you see div soup as far as the eyes can see. A man with a blue shirt scanning the distance for something.(https://media.giphy.com/media/i4JiDqwoV3A0ZO9d23/giphy.gif) So since this craze started taking hold, many developers are grabbing the reins and sowing the seeds in the fields of web pages with divs. Planting and nurturing them until their web site blooms fully. A garden of divs for everyone to see. Then the accessibility people said, "Wait a minute. Try not to use so many divs. They hold no semantic meaning and use semantic HTML elements like section it is much better for accessibility." Then the gardeners that are the developers started using the section element, and planting those seeds. And planting them. And planting them. Now we have a garden, not only overflowing with div elements, but that same garden we call the Web is not choking with the overplanting of section elements. Well how do we achieve this? Know When To Hold 'Em As with the div element, moderation is the key. You should know when to hold 'em. For example: css

Discussion in the ATmosphere

Loading comments...