Home  >  Article  >  Web Front-end  >  Detailed example of writing format of css style

Detailed example of writing format of css style

高洛峰
高洛峰Original
2017-03-04 10:38:322103browse

There are three writing formats for css

Inline style: means to write the style inline

For example 6461c6dfca0a6eeeab98debb3c9d2399write my color with inline style94b3e26ee717c64999d7867364b1b4a3

only applies to 6c04bd5ca3fcae76e30b72ad730ca86d (font color and background color) and tags inside 6c04bd5ca3fcae76e30b72ad730ca86d, but it does not apply to tags outside 6c04bd5ca3fcae76e30b72ad730ca86d such as: head, title, etc.

Embedded styles: Use style to uninstall all styles in style.

For example:

<head>

<style>

p{   

color:red;   

background:blue;   

border:1px solid green;   

}   

</style>

</head>

<body>

<p>用内嵌方式编写我的样式</p>

</body>

External link style: The popular point is the external style, which uses the link style to connect to the external .css file.

For example:

<head>

  <link style="stylesheet" href="class.css" type="text/css" />

</head>

Yes, it’s so simple. You only need to write the css style to another .css text and then just link it on the page. The style is displayed in , but be sure to pay attention to the file path! ! ! It’s okay if the path is wrong.

I personally recommend using external style, which separates css and layout code, making the code more editable and loading faster.

The above detailed explanation of the writing format of citing css style is all the content shared by the editor. I hope it can give you a reference, and I also hope that everyone will support the PHP Chinese website.

For more detailed examples of css style writing formats and related articles, please pay attention to 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