Required elements and optional tags in HTML
In HTML, some elements have optional tags. In fact, both the opening and closing tags of some elements may be completely removed from an HTML document, even though the elements themselves are required. Does that seem a bit confusing?
It can seem strange, especially considering that three required HTML elements whose start and end tags are optional are the
body elements. Yes, you can leave those out of your markup in HTML (but not in XHTML). The browser will still create the elements, and they will be available in the document tree.
Still confused? Read Gez Lemon’s detailed explanation in Required Elements, and Required Tags.
Subscribe / follow
- Project/Product Manager – H+K Digital at Hill+Knowlton Strategies (Dallas, TX, US)
- Senior Front End Developer at Synacor, Inc. (Buffalo, NY, Ne, US)
- Project Manager at Mule (San Francisco, CA, Ca, US)
- Public Information Specialist I (Limited-Term) at West Basin Municipal Water District (Carson, CA, Ca, US)
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost