Four ways to add a CSS style sheet to a Web page, you can choose the way you like it, depending on your needs.
First, use the Style property: Add the style attribute directly to the individual component label.
< element (label) style= "Properties (attribute) 1: setpoint 1; Property (Attribute) 2: Set value 2; ...}
For example:
<TD style= "Color:blue; font-size:9pt; Font-family: "marked in italics"; Line-height:150%>
The advantage of this usage is that it is dexterous to apply styles to each label, but the disadvantage is that there is no "uniformity" of the entire document.
second, use style tags: write style rules in <STYLE>...</STYLE> tags.
The code is as follows:
<style type= "Text/css" > <!--Style rules table--</STYLE> For example: <style type= "Text/css" > <!--BODY {color: BLUE; Background: #FFFFCC; FONT-SIZE:9PT} TD, P {color:green; font-size:9pt}-</STYLE>
Usually the entire <STYLE>...</STYLE> structure is written in the <HEAD> </HEAD> section of the Web page. The advantage of this usage is that the entire document is uniform, as long as it is a declared component that applies the style rule. The disadvantage is that the flexibility of individual components is insufficient.
third, use the LINK tag: write the style rules in the. CSS style file, and then introduce the <LINK> tag.
Let's say we save the style rule as a example.css file, we just add it to the page
<link rel=stylesheet type= "text/css" href= "Example.css" >
You can apply the styles you've made in the style file. The link tag is usually written in the
Iv. Introduction using @import: Much like link usage, but must be placed in <STYLE>...</STYLE>.
The code is as follows:
<style type= "Text/css" > <!--@import url (the address, path, and file name of the introduced style sheet); -</STYLE> For example: <style type= "Text/css" > <!--@import url (http://yourweb/example.css); -</STYLE>
Note that the semicolon at the end of the line is absolutely indispensable! This way you can also put
@import URL (http://yourweb/example.css);
Added to other styles within the call.