Home > Article > Web Front-end > Is css case insensitive?
In HTML files, CSS is not case-sensitive. When using CSS in XHTML, element names defined in CSS are case-sensitive. Cascading style sheets are a computer language used to express document styles such as HTML or XML.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Cascading Style Sheets (English full name: Cascading Style Sheets) is a computer used to express document styles such as HTML (an application of Standard Generalized Markup Language) or XML (a subset of Standard Generalized Markup Language). language.
In HTML files, CSS is not case-sensitive. When using CSS in XHTML, element names defined in CSS are case-sensitive.
Example:
<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <!-- 声明为XHTML类型的,如果去掉此行,则为普通的HTML类型 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>URI utility</title> <style type="text/css"> <!-- BODY { border: 1px solid blue; } .Row { border: 1px solid red; padding: 2px 2px 2px 2px; margin: 4px 10px; } --> </style> </head> <body> <div class="main"> <form name="form1"> <div class="row"> <input type="text" name="uri1" size="60" /><br/> </div> </form> </div> </body> </html>
However, in XHTML, CSS is still case-insensitive for basic HTML tags. BODY in this example can still be applied to the
tag.Effect comparison:
In XHTML:
In HTML:
Extended information:
XHTML
Extensible Hypertext Markup Language (English: eXtensible HyperText Markup Language, Text Markup Language (HTML) is similar, but syntactically stricter.
In terms of inheritance relationship, HTML is an application based on Standard General Markup Language (SGML) and is a very flexible markup language, while XHTML is based on Extensible Markup Language (XML). XML Is a subset of SGML. XHTML 1.0 became a W3C recommendation on January 26, 2000.
Recommended learning: css video tutorial
The above is the detailed content of Is css case insensitive?. For more information, please follow other related articles on the PHP Chinese website!