in

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

1679949179 cf11b3ed553d6c359d3dcc08377cc4b121fe8bf0

[ad_1]

Hello,

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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
> <meta charset="utf-8" />
> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
> <link rel="stylesheet" href="https://www.sitepoint.com/community/t/xhtml-should-doctype-meta-and-link-be-closed-as-single-tags/411625/./stylesheet.css" />

Thank you for your understanding on my question.

your friends,

RedC3ll


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,

RedC3ll



1 like

[ad_2]

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