I have a html document:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
In it I have tags such as
<br />
But Im reading that this tag is an XHTML element. Yet it still works why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Browsers failed to implement parsers that correctly handled HTML 4 and earlier.
They should have treated
<br/>as “A br element followed by a greater than sign”, but instead implemented it as “A br element with a/attribute, what’s a/attribute? We’ll drop it”. This led to the feature being marked as something to avoid.XHTML then exploited the bug for HTML-Compatible XHTML.
HTML 5 then redefined it as syntactic sugar so the XHTML junkies could keep on using the syntax they were used to.