样式表中文手册。什(shí)么(me)是样式表:CSS 是 Cascading Style Sheet 的缩写(xiě)。译作「层叠样式表单」。是用于(yú)(增(zēng)强)控制网(wǎng)页样(yàng)式并允许将样(yàng)式信息(xī)与网页内容分离的一种标记性语(yǔ)言。如(rú)何将(jiāng)样式表加入(rù)您(nín)的网页(yè):你可以(yǐ)用以下(xià)三(sān)种方式将样式表(biǎo)加入您(nín)的网页。而最接近目(mù)标的样式定(dìng)义(yì)优先权越高。高优先权样式将继承低优先权样式的未重叠定义但覆盖重叠的定义(yì)。
入外部(bù)样式表文件 (Linking to a Style Sheet)
你可以先建立(lì)外部样(yàng)式(shì)表文件(.css),然后使用HTML的link对象。示(shì)例如下:
<head>
<title>文档标题</title>
<link rel=stylesheet href="http://www.dhtmlet.com/dhtmlet.css" type="text/css">
</head>
而(ér)在(zài)XML中,你应(yīng)该如下例所示在声明区中加入(rù):
<? xml-stylesheet type="text/css" href="http://www.dhtmlet.com/dhtmlet.css" ?>
定义内(nèi)部样式块对象 (Embedding a Style Block)
你(nǐ)可以在(zài)你的HTML文档的(de)<HTML>和<BODY>标(biāo)记之间(jiān)插入一(yī)个<STYLE>...</STYLE>块对象。
<html>
<head>
<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>
这(zhè)里将style对象(xiàng)的type属性(xìng)设置为(wéi)"text/css",是(shì)允许不支持这类型的(de)浏览器忽略样式表单。
内联定义 (Inline Styles)
内联定义即是在对象的标记内使用对象的style属性定义适用其的样式表属(shǔ)性。示例如下:
<p style="margin-left: 0.5in; margin-right:0.5in">这一行被(bèi)增加了左(zuǒ)右的外补丁<p>
样式表语法 (CSS Syntax)
Selector { property: value }
参数说(shuō)明:
Selector -- 选择符
property : value -- 样式表定义。属性和属性值之间用冒号(:)隔开。多个定义之间(jiān)用分号(;)隔开
继(jì)承的值(zhí) (The ' Inherit ' Value)
每个属性都有一个指(zhǐ)定的值: Inherit 。它的意思是(shì):将父对象的值(zhí)等同为计算(suàn)机值得到(dào)。这个值通(tōng)常仅仅是备用的。显(xiǎn)式的声明(míng)它可用来强调。
Properties Reference
文本属性 Text Properties
表格属性(xìng) Table Properties
滚(gǔn)动条(tiáo)属性 Scrollbar Properties
打印属性 Printing Properties
定位(wèi)属性 Positioning Properties
内(nèi)补丁属(shǔ)性(xìng) Paddings Properties
轮廓属(shǔ)性 Outlines Properties
外补丁属性 Margins Properties
列(liè)表属性 Lists Properties
布局属性 Layout Properties
字体属性 Font Properties
尺寸属性 Dimensions Properties
内容(róng)属性(xìng) Generated Content Properties
边框属(shǔ)性 Borders Properties
背景属(shǔ)性(xìng) Background Properties
声音属性 Aural Properties
