Detailed example of writing format of css style

高洛峰
Release: 2017-03-04 10:38:32
Original
2097 people have browsed it

There are three writing formats for css

Inline style: means to write the style inline

For example

write my color with inline style

only applies to (font color and background color) and tags inside , but it does not apply to tags outside 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>
Copy after login

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>
Copy after login

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!