", where text refers to the object as the text in the web page, and css or javascript refers to the currently specified text type."/> ", where text refers to the object as the text in the web page, and css or javascript refers to the currently specified text type.">

Home  >  Article  >  Web Front-end  >  What does type mean in css

What does type mean in css

藏色散人
藏色散人Original
2021-05-17 15:14:396018browse

Type in css is used to specify the MIME type, such as the statement "080b747a20f9163200dd0a7d304ba388", where text refers to the object being the text in the web page, and css or javascript refers to The currently specified text type.

What does type mean in css

The operating environment of this article: windows7 system, css3 version, Dell G3 computer.

What does type mean in css?

080b747a20f9163200dd0a7d304ba388 type="text/css"

type="text/css" specifies the MIME type, where:

text refers to the text in the web page

css or javascript refers to the currently specified text type.. .

If you want to apply CSS styles in HTML files, there are three most commonly used methods:

1. Internal reference

The so-called internal reference is to use the style tag to reference the same The css definition of the ef1cac8df639bc9110cb13b8b5ab3dd734934661d7147ca926b095899343bad0 part of the HTML page. For example:

<html>
<head>
<style type="text/css">
.cssstyle { font:12px;
color:#339966;
border:1px #e1763d solid;
}
<style/>
</head>
<body>
<div class="cssstyle"> THIS IS A PARTS OF TEXT WHICH LINK CSS STYLE IN HEAD PART</div>
</body>
</html>

2. External reference

External reference is to use the 2cdf5bf648cf2f33323966d7f58a7f3f tag to reference the style in the external CSS file. If you want to achieve the above effect, you can make the CSS into a separate file.

File CSSSTYLE.CSS

.cssstyle { font:12px;
color:#339966;
border:1px #e1763d solid;
}

Then reference it in HTML:

<html>
<head>
<link rel="stylesheet" type="text/css" href="cssstyle.css">
</head>
<body>
<div class="cssstyle"> THIS IS A PARTS OF TEXT WHICH LINK CSS STYLE IN HEAD PART</div>
</body>
</html>

Use this method to reference to ensure that the relative paths of the CSS file and HTML file are complete, otherwise CSS styles will not be found in HTML documents.

3. Inline reference

Inline reference is actually to define the CSS style directly on the tag used in the HTML part where the CSS style is applied. This method is the most direct, but it also has disadvantages. The most obvious and biggest problem is that the code is cumbersome and the scope is only within the scope of the defined tag. Such as:

<p style="color:#ccc">THIS TEXT IS GREY</p>
<p>I AM NOT GREY, WHAT COLOR AM I? :)</p>

Recommended study: "css video tutorial"

The above is the detailed content of What does type mean in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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