Out of idle curiosity, which better element am I supposed to use when I'm using flex layout to space out elements on my page?
(e.g., a toolbar with with left- and right- justified elements, among which is an expanding searchbox).
Re:Every HTML Element
by assimpleaspossi on Saturday January 25, 2025 @07:39PM
(#42826525)
HTML elements are used to describe their content and not have anything to do with layout. While they often have common properties, these can be changed using CSS.
So use the element that best describes its content.
If you can't do it, there is probably more work to do with your document structure. Also try and always have a h1-h6 heading in your articles, sections, asides and even navs, at the top. Headings should not be in a sea of paragraphs, they should be at the top of a content sectioning element, nowhere else.