Are XHTML style close tags valid in HTML? What I mean is, in XHTML we use <link href="style.css" type="text/css" rel="stylesheet" />. Is this valid in HTML? or should I be using <link href="style.css" type="text/css" rel="stylesheet"></link>?
Are XHTML style close tags valid in HTML? What I mean is, in XHTML
Share
They are invalid in HTML4 for the
LINKelement.But XML-style tags as in your question are valid in HTML5:
Basically, HTML5 allows XML/XHTML style markup. That’s the nice thing of HTML5. You aren’t forced to serve XHTML as
application/xml+htmlwhich would only cause IE to havoc. Just serve it astext/htmlwith a<!DOCTYPE html>in top of the page and you’re safe.