国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Introduction to CSS

What is CSS

CSS (Cascading Stylesheets, cascading style sheets) is a new technology for making web pages, which is now used by most browsers Supported, it has become one of the indispensable tools for web design. Using CSS can simplify the format code of web pages, speed up the download and display speed, reduce the amount of code that needs to be uploaded, and greatly reduce the workload of repeated work. Especially when you are facing a site with hundreds of web pages, CSS is like a gift from God to us!

W3C (The World Wide Web Consortium) divides dynamic HTML (Dynamic HTML) into three parts to implement: scripting language (including javascript, Vbscript, etc.), browsers that support dynamic effects (including Internet Explorer, Netscape Navigator, etc.) and CSS style sheets.

Cascading order

When the same HTML element is defined by more than one style, which style will be used?

Generally speaking, all styles will be cascaded in a new virtual style sheet according to the following rules, with number 4 having the highest priority.

1. Browser default settings

2. External style sheet

3. Internal style sheet (located inside the <head> tag)

4. Inline styles (inside HTML elements)

CSS syntax

CSS rules consist of two main parts: selectors, and one or more declarations:

1008.png

The selector is usually the HTML element you need to change the style of.

Each statement consists of an attribute and a value.

The property is the style attribute you wish to set. Each attribute has a value. Properties and values ??are separated by colons.

CSS Comments

Comments are used to explain your code, and you can edit it at will, the browser will ignore it.

CSS comments start with "/*" and end with "*/". Examples are as follows:

/*This is a comment*/
p
{
text-align:center;
/*This is another comment*/
color:black;
font-family:arial;
}

Example:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<style>
body {background-color:yellow;}
p{color:red;text-align:center;} 
</style>
</head>
<body>
<p>Hello World!</p>
<p>這是一個CSS測試實例</p>
</body>
</html>



Continuing Learning
||
<html> <head> <title>利用背景顏色分塊</title> <style> body{ padding:0px; margin:0px; background-color:#ffebe5; /* 頁面背景色 */ } .topbanner{ background-color:#fbc9ba; /* 頂端banner的背景色 */ } .leftbanner{ width:22%; height:330px; vertical-align:top; background-color:#6d1700; /* 左側(cè)導(dǎo)航條的背景色 */ color:#FFFFFF; text-align:left; padding-left:40px; font-size:14px; } .mainpart{ text-align:center; } </style> </head> <body> <table cellpadding="0" cellspacing="1" width="100%" border="0"> <tr> <td colspan="2" class="topbanner">這是頂端</td> </tr> <tr> <td class="leftbanner"> <br><br>首頁<br><br>分類討論 <br><br>談天說地<br><br>精華區(qū) <br><br>我的信箱<br><br>休閑娛樂 <br><br>立即注冊<br><br>離開本站 </td> <td class="mainpart">正文內(nèi)容...</td> </tr> </table> </body> </html>
submitReset Code