Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is HTML case sensitive?

Tags:

html

Is HTML case sensitive?

In an example I'm working with it says:

<!DOCTYPE html> 

Would <!doctype html> or <!DocType Html> work differently (or not at all)?

like image 811
David Oneill Avatar asked Dec 04 '10 04:12

David Oneill


People also ask

Is HTML case sensitive yes or no?

HTML is case insensitive.

Are HTML tag case sensitive?

Tag names for HTML elements must exactly match the names of the elements given in the HTML elements section of this document; that is, tag names are case-sensitive.

Why HTML is not a case sensitive?

In HTML, the attribute and tag names are case-insensitive. The close association of HTML and JavaScript can lead to confusion, so case sensitivity is more important in JavaScript. For example, HTML onclick event attribute is mentioned as onClick in HTML but should be onclick in JavaScript.

Is HTML and CSS case sensitive?

CSS selectors are generally case-insensitive; this includes class and ID selectors. But HTML class names are case-sensitive (see the attribute definition), and that's causing a mismatch in your second example.


1 Answers

No, but it's considered good practice to keep HTML markup lowercase.

like image 76
Roddick Avatar answered Sep 21 '22 15:09

Roddick