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