XHTML: Should Doctype, Meta and Link be closed as single tags? – HTML and CSS – SitePoint Forum

1679949179 cf11b3ed553d6c359d3dcc08377cc4b121fe8bf0



I’m following the XHTML video tutorial. The main difference between HTML5 and XHTML is that single tags are closed with a slash. <img />, <hr />.

I was wondering if the same is done with doctype, meta and link.

> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "" />
> <meta charset="utf-8" />
> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
> <link rel="stylesheet" href="" />

Thank you for your understanding on my question.

your friends,


Yes, for all elements in the html structure. This includes things like meta and links.

The doctype is different because it’s an instruction to the browser on how to interpret the html and everything in it. Therefore, it is not a markup tag per se and does not have a closing slash.

1 like

Thank you for your explanation.

your friends,


1 like


Source link

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

    129165541 gettyimages 1249295386

    Gwyneth Paltrow ski crash trial: Who's who

    Vyopta Logo

    Vyopta’s User Experience Score provides visibility into the overall health of organizational collaboration