Inline css styles

Where can CSS styles be written? From the perspective of the form of CSS style code insertion, it can be basically divided into the following three types: inline, embedded and external. This section first explains the inline style.

Inlinecss style sheet is to write the css code directly in the existing HTML tag, such as the following code:

<p style="color:red">这里文字是红色。</p>

Note that it should be written at the beginning of the element In the tag, the following writing is wrong:

<p>这里文字是红色。</p style="color:red">

And the css style code must be written in style="" double quotes. If there are multiple css style code settings, they can be written together, in the middle Separate with semicolons. The following code:

<p style="color:red;font-size:12px">这里文字是红色。</p>
Continuing Learning
||
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>html</title>
<style type="text/css">
span{
color:red;
}
</style>
</head>
<body>
<p>PHP<span style="color:blue"></span
     >IT<span></span><span
     ></span></p>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
submitReset Code
图片放大关闭