|
此属性用来指定网页或某一区块的背景图案。画底线的部分可以使用图档的绝对位置或相对位置来表示之。
使用此标签时,最好同时也指定一个类似的颜色做背景颜色。
参考范例:
BODY { background-image: url (/images/2T_logo.gif); background-color: #ededff } LI { background-image: url http://www.2T.com/2T_logo.gif); background-color: #cef }
{background: (…)}
此标签可以集结所有跟 background 有关的扩充属性在此一标签内,所以您可以将所有上述介绍过的 background 属性一起加进来。
参考范例:
BODY {background: white url (/images/2T_logo.gif) repeat-y} LI {background: #cc88ff url http://www.2T.com/2T_logo.gif) no-repeat}
CSS 中 Text 的扩充属性 {text-decoration: none}
此属性用来指定文字是否画有底线或被线条杠掉(如:被线条杠掉此例)。画底线的部分可以用 none, underline, line-through 来替换之。
此属性的内定值为 none。
参考范例:
P { color: navy; text-decoration: none } A:link, A:visited, A:active { text-decoration: underline }
{text-align: left}
此属性用来指定文字是向左、向中、或向右对齐。画底线的部分可以用 left, right, center, justify 来替换之。
参考范例:
P {text-align: left} H1 {text-align: center}
{text-indent: 2cm} 此属性用来指定文字向右凹进去多少公分、厘米、英寸、点数(point)、图素(pixel)、或多少 % 。测量单位可以用 cm, mm, in, pt, px, %来表示之。 % 是以母标签来相对比。
参考范例:
P {text-indent: 3cm} LI {text-indent: 60px} BLOCKQUOTE {text-indent: 20%}
{line-height: 14pt}
此属性用来指定每行行距的高度。line-height 常与字体大小 font-size 一起并用,写成 12pt/14pt (12pt 指的是字体的大小,14pt 指的是行距的高度)。line-height也可以用 % 表示之。 % 是以母标签来相对比。
参考范例:
BODY { font-size: 12pt; line-height:14pt } H1 { font-size: 150%; line-height: 200% }
H4 {font: 16pt/20pt bold italic}
CSS 中 Margin, Padding 的扩充属性 {margin: 3cm}
此属性用来指定网页的上下左右边缘,各需留白多少公分、厘米、英寸、点数(point)、图素(pixel)、或多少 % 。测量单位可以用 cm, mm, in, pt, px, %来表示之。 % 是以母标签来相对比。
margin 可以用 margin-top, margin-bottom, margin-left, margin-right来替换之。
此属性的内定值为 0。
参考范例:
BODY { margin-top: 44px; margin-bottom: 2cm; margin-left: 66px; margin-right: 1.5in } P {margin: 15pt}
{padding: 14px}
此属性用来指定各段落或各区块间,上下左右边缘各需留白多少公分、厘米、英寸、点数(point)、图素(pixel)、或多少 % 。测量单位可以用 cm, mm, in, pt, px, %来表示之。 % 是以母标签来相对比。
padding 可以用 padding-top, padding-bottom, padding-left, padding-right来替换之。
此属性的内定值为 0。IE3 不支援所有与 padding 相关的标签。
参考范例:
BODY {margin: 15pt} DL { padding-top: 22px; padding-left: 20%; }
上一页 [1] [2] [3]
CSS是如何在网页中调用的 |