external css style

External css style (also called external style) is to write the css code in a separate external file. This css style file has the extension name of ".css" and is in <head> (not in <style> tag) Use the <link> tag to link the css style file to the HTML file, as shown in the following code:

<link href="base.css" rel="stylesheet" type="text/css" />

Note:

1. The name of the css style file begins with Named with English letters of meaning, such as main.css.

2. rel="stylesheet" type="text/css" is a fixed writing method that cannot be modified.

3. The <link> tag position is generally written within the <head> tag.

body { line-height: 130pt}
H1,H2,H3,H4,H5,H6 {
color: red;
text-decoration: underline;
font-family: " 黑体 "
}
b {
font-style: italic;
color: #FF3333;
text-decoration: underline
}

We see that only the < STYLE> and comment tags are missing, and the rest of the external style sheet has not changed.

Continuing Learning
||
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <link href="mycss.css" type="text/css" rel="stylesheet"> </head> <body> <!--p 标签中嵌套了一个 a 标签,在下面的 css 引用过程中我们可以看到的.pclass a 即为 class 被用作派生选择器--> <p class="pclass">这是一个 class 显示效果<a href="hhtp://www.php.cn">效果</a></p> <div class="divclass">hello div</div> </body> </html>
submitReset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!