Home > Web Front-end > Front-end Q&A > Is css case sensitive?

Is css case sensitive?

藏色散人
Release: 2023-01-05 16:10:41
Original
3482 people have browsed it

CSS is not case-sensitive in HTML files, but when using CSS in XHTML, the element names defined in CSS are case-sensitive.

Is css case sensitive?

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Is css case sensitive?

Cascading Style Sheets (English full name: Cascading Style Sheets) are files used to express HTML (an application of Standard Generalized Markup Language) or XML (a subset of Standard Generalized Markup Language). style computer 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>
Copy after login

However, in XHTML, CSS is still case-insensitive for basic HTML tags. BODY in this example can still be applied to the

tag.

[Recommended learning: css video tutorial]

Effect comparison:

In XHTML:

Is css case sensitive?

HTML:

Is css case sensitive?

XHTML:

Extensible Hypertext Markup Language (English: eXtensible HyperText Markup Language, The language is similar to Hypertext Markup Language (HTML), but the syntax is more strict.

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.

The above is the detailed content of Is css case sensitive?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template