Before learning to apply css, we must first understand what css is. CSS is the abbreviation of Cascading Style Sheets.
* The CSS language is a markup language that does not require compilation and can be executed directly by the browser (it is a browser interpreted language).
* CSS is responsible for standard web design The performance of web page content (XHTML).
* A CSS file can also be said to be a text file, which contains some CSS tags. The CSS file must use css as the file name suffix.
* The overall performance of the web page can be changed by simply changing the CSS file. Form can reduce our workload, so it is a required course for every web designer.
* CSS is produced and maintained by the CSS working group of W3C.
After understanding what CSS is, we can easily apply it. We can add it to your blog in the following two ways, because the application method of css has the principle of proximity. That is to say, the style definition closest to the target has higher priority. A high-priority style will inherit the non-overlapping definitions of the low-priority style but override the overlapping definitions.
Linking to an external style sheet file (Linking to a Style Sheet)
You can first create an external style sheet file (.css), and then use the HTML link object. An example is as follows:
<head>
<title>Document title</title>
<link rel=stylesheet href=" http://www.devdao.com/dhtmlet.css " type="text/css">
</head>
In XML, you should add it in the declaration area as shown in the following example:
<? xml-stylesheet type="text/css" href=" http://www.123-seo.cn/dhtmlet. css "?>
Define an internal style block object (Embedding a Style Block)
You can insert a <STYLE>...</STYLE> block object between the <HTML> and <BODY> tags in your HTML document. For definition methods, please refer to style sheet syntax. An example is as follows:
<html>
<head>
<title>Document title</title>
<style type="text/css">
<!--
body {font: 10pt "Arial"}
h1 {font: 15pt/17pt "Arial"; font-weight: bold; color: maroon}
h2 {font: 13pt/15pt "Arial"; font-weight: bold; color: blue}
p {font: 10pt/12pt "Arial"; color: black}
-->
</style>
</head>
<body>
Please note that setting the type attribute of the style object to "text/css" here allows browsers that do not support this type to ignore the style sheet.