css常用的属性大全

合集下载

css常用属性

css常用属性

normal :默认值。默认行高 length :百分比数字 | 由浮点数字和单位标识符 组成的长度值,允许为负值。其百分比取值是基于字 体的高度尺寸
Code:ex04/css_news.htm
常用css属性——文本控制
text-align : left | right | center | justify 设置或检索对象中文本的对齐方式。 left :默认值。左对齐 right :右对齐 center :居中对齐 justify :两端对齐 auto :自动 baseline :基线对齐 sub :垂直对齐文本的下标 super :垂直对齐文本的上标 top :内容对象顶端对齐 text-top :将支持 valign 特性的对象的文本与对 象顶端对齐 middle :中部对齐 bottom :底端对齐 text-bottom :文本与对象底端对齐 length :CSS2功能 由浮点数字和单位标识符组成的长度值 | 百分数。 可为负数。定义由基线算起的偏移量。基线对于数值 来说为0,对于百分数来说就是0%。 normal :默认值。允许在词间换行 break-all :与 normal 相同。也允许非亚洲语言文 本行的任意字内断开。 keep-all :对于中文,韩文,日文,不允许字断开。 适合包含少量亚洲文本的非亚洲文本
background-color : transparent | color background-image : none | url ( url ) background-position : position || position background-repeat : repeat | no-repeat | repeat-x | repeat-y layer-background-color : transparent | color background:颜色 背景图片 重复性 位置; 应用举例: 1、表格的背景图像和背景色 2、给textarea生成水平笔记效果 3、制作重复性背景图片、图片虚线的技巧。 背景色 背景图像 背景图像的定位,位置坐标 指定背景图像是否重复,怎么重复 指定背景色透明 可仅用background代替上面各属性。

常用CSS代码大全(工作必备)

常用CSS代码大全(工作必备)

常用CSS代码大全(工作必备)用html+css可以很方便的进行网页的排版布局,但不是每一种属性或者代码我们都铭记于心,最近我把CSS中的常用代码进行了归纳总结,方便自己以后查看,同时也分享给大家,希望对你们有用。

一.文本设置1、font-size: 字号参数2、font-style: 字体格式3、font-weight: 字体粗细4、颜色属性 color:参数注意使用网页安全色二、超链接设置text-decoration: 参数主要目的是在浏览器显示文本链接时更改下划线。

参数取值范围:underline:为文字加下划线overline:为文字加上划线line-through:为文字加删除线blink:使文字闪烁none:不显示上述任何效果三、背景1、背景颜色 padding: 0px 0px 0px 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(61, 70, 77); font-size: 16px; border-left: 1px solid rgb(128, 128, 128); background: rgb(238, 238, 238); box-shadow: rgba(7, 17, 27, 0.05) 0px 4px 8px 0px; box-sizing: border-box; border-radius: 8px; font-family: "Helvetica Neue", Helvetica, "PingFang SC", 微软雅黑, Tahoma, Arial, sans-serif;">2、背景图片background-image: url(URL)URL就是背景图片的存放路径,none表示无。

3、背景图片重复 background-repeat: 参数参数取值范围:no-repeat:不重复平铺背景图片repeat-x:使图片只在水平方向上平铺repeat-y:使图片只在垂直方向上平铺如果不指定背景图像重复属性,浏览器默认水平和垂直平铺背景图像。

CSS——八大属性

CSS——八大属性

CSS——⼋⼤属性⼀、颜⾊有三种表⽰颜⾊的⽅法:英⽂单词、⼆进制颜⾊代表码、rgb,⼆、字体font-size:15px;设置字体⼤⼩,常⽤像素指定字体⼤⼩,指定长度的字号,不会随着浏览器的变化⽽变化font-family:宋体;设置字体类型font-weight:lighter、bold、bolder,设置字体粗细,常⽤的三种效果选择font-style:oblique;设置字体倾斜font-variant:small-caps;将⼩写字母转成⼤写字母;color:设置字体颜⾊<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>exercise4</title><style>#color_en{color:blue}#color_bin{color:#F0F;}#color_rgb{color:rgb(255,0,255)}#color_pellucidity{color:rgba(255,0,255,0.2)}#ablout_font{background-color:rgba(0,255,255,0.2);}#font_size{background-color:rgba(0,255,255,0.2);font-size:15px;}#font_family{background-color:rgba(0,255,255,0.2);font-family:YouYuan;}#font_lighter{background-color:rgba(0,255,255,0.2);font-weight:lighter;}#font_bold{background-color:rgba(0,255,255,0.2);font-weight:bold;}#font_bolder{background-color:rgba(0,255,255,0.2);font-weight:bolder;}#font_style{background-color:rgba(0,255,255,0.2);font-style:oblique;}</style></head><body><p>练习属性property</p><p id="ablout_font">⼆、关于字体</p><p id="font_size">font-size设置字体⼤⼩,如:15px</p><p id="font_family">font-family设置字体类型如:YouYuan</p><p id="font_weight"><a id="font_bolder">bolder</a></p><p id="font_style">font-style设置字体倾斜</p><p id="color_en">⼀、关于颜⾊</p><p id="color_bin">除了使⽤英⽂单词,还可以使⽤⼗六进制颜⾊对应表(如下图,#FFFF00表⽰黄⾊,还可简写成#FF0)<table border="0"><tbody><tr><td height="30" width="95" bgcolor="#ffffff">#FFFFFF</td><td height="30" width="95" bgcolor="#dddddd">#DDDDDD</td><td height="30" width="95" bgcolor="#aaaaaa">#AAAAAA</td><td height="30" width="95" bgcolor="#888888">#888888</td><td height="30" width="95" bgcolor="#666666">#666666</td><td height="30" width="95" bgcolor="#444444">#444444</td><td height="30" width="95" bgcolor="#000000">#000000</td></tr><tr><td height="30" width="95" bgcolor="#ffb7dd">#FFB7DD</td><td height="30" width="95" bgcolor="#ff88c2">#FF88C2</td><td height="30" width="95" bgcolor="#ff44aa">#FF44AA&nbsp;</td><td height="30" width="95" bgcolor="#ff0088">#FF0088&nbsp;</td><td height="30" width="95" bgcolor="#c10066">#C10066&nbsp;</td><td height="30" width="95" bgcolor="#a20055">#A20055&nbsp;</td><td height="30" width="95" bgcolor="#8c0044">#8C0044&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#ffcccc">#FFCCCC</td><td height="30" width="95" bgcolor="#ff8888">#FF8888</td><td height="30" width="95" bgcolor="#ff3333">#FF3333&nbsp;</td><td height="30" width="95" bgcolor="#ff0000">#FF0000&nbsp;</td><td height="30" width="95" bgcolor="#cc0000">#CC0000&nbsp;</td><td height="30" width="95" bgcolor="#aa0000">#AA0000&nbsp;</td><td height="30" width="95" bgcolor="#880000">#880000&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#ffc8b4">#FFC8B4</td><td height="30" width="95" bgcolor="#ffa488">#FFA488</td><td height="30" width="95" bgcolor="#ff7744">#FF7744&nbsp;</td><td height="30" width="95" bgcolor="#ff5511">#FF5511&nbsp;</td><td height="30" width="95" bgcolor="#e63f00">#E63F00&nbsp;</td><td height="30" width="95" bgcolor="#c63300">#C63300&nbsp;</td><td height="30" width="95" bgcolor="#a42d00">#A42D00&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#ffddaa">#FFDDAA</td><td height="30" width="95" bgcolor="#ffbb66">#FFBB66</td><td height="30" width="95" bgcolor="#ffaa33">#FFAA33</td><td height="30" width="95" bgcolor="#ff8800">#FF8800&nbsp;</td><td height="30" width="95" bgcolor="#ee7700">#EE7700&nbsp;</td><td height="30" width="95" bgcolor="#cc6600">#CC6600&nbsp;</td><td height="30" width="95" bgcolor="#bb5500">#BB5500&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#ffee99">#FFEE99</td><td height="30" width="95" bgcolor="#ffdd55">#FFDD55</td><td height="30" width="95" bgcolor="#ffcc22">#FFCC22</td><td height="30" width="95" bgcolor="#ffbb00">#FFBB00&nbsp;</td><td height="30" width="95" bgcolor="#ddaa00">#DDAA00&nbsp;</td><td height="30" width="95" bgcolor="#aa7700">#AA7700&nbsp;</td><td height="30" width="95" bgcolor="#886600">#886600&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#ffffbb">#FFFFBB</td><td height="30" width="95" bgcolor="#ffff77">#FFFF77</td><td height="30" width="95" bgcolor="#ffff33">#FFFF33</td><td height="30" width="95" bgcolor="#ffff00">#FFFF00</td><td height="30" width="95" bgcolor="#eeee00">#EEEE00</td><td height="30" width="95" bgcolor="#bbbb00">#BBBB00</td><td height="30" width="95" bgcolor="#888800">#888800</td></tr><tr><td height="30" width="95" bgcolor="#eeffbb">#EEFFBB</td><td height="30" width="95" bgcolor="#ddff77">#DDFF77</td><td height="30" width="95" bgcolor="#ccff33">#CCFF33</td><td height="30" width="95" bgcolor="#bbff00">#BBFF00</td><td height="30" width="95" bgcolor="#99dd00">#99DD00</td><td height="30" width="95" bgcolor="#88aa00">#88AA00</td><td height="30" width="95" bgcolor="#ccff99">#CCFF99</td><td height="30" width="95" bgcolor="#bbff66">#BBFF66</td><td height="30" width="95" bgcolor="#99ff33">#99FF33</td><td height="30" width="95" bgcolor="#77ff00">#77FF00</td><td height="30" width="95" bgcolor="#66dd00">#66DD00</td><td height="30" width="95" bgcolor="#55aa00">#55AA00</td><td height="30" width="95" bgcolor="#227700">#227700</td></tr><tr><td height="30" width="95" bgcolor="#99ff99">#99FF99</td><td height="30" width="95" bgcolor="#66ff66">#66FF66</td><td height="30" width="95" bgcolor="#33ff33">#33FF33</td><td height="30" width="95" bgcolor="#00ff00">#00FF00</td><td height="30" width="95" bgcolor="#00dd00">#00DD00</td><td height="30" width="95" bgcolor="#00aa00">#00AA00</td><td height="30" width="95" bgcolor="#008800">#008800</td></tr><tr><td height="30" width="95" bgcolor="#bbffee">#BBFFEE</td><td height="30" width="95" bgcolor="#77ffcc">#77FFCC</td><td height="30" width="95" bgcolor="#33ffaa">#33FFAA</td><td height="30" width="95" bgcolor="#00ff99">#00FF99</td><td height="30" width="95" bgcolor="#00dd77">#00DD77</td><td height="30" width="95" bgcolor="#00aa55">#00AA55</td><td height="30" width="95" bgcolor="#008844">#008844</td></tr><tr><td height="30" width="95" bgcolor="#aaffee">#AAFFEE</td><td height="30" width="95" bgcolor="#77ffee">#77FFEE</td><td height="30" width="95" bgcolor="#33ffdd">#33FFDD</td><td height="30" width="95" bgcolor="#00ffcc">#00FFCC</td><td height="30" width="95" bgcolor="#00ddaa">#00DDAA</td><td height="30" width="95" bgcolor="#00aa88">#00AA88</td><td height="30" width="95" bgcolor="#008866">#008866</td></tr><tr><td height="30" width="95" bgcolor="#99ffff">#99FFFF</td><td height="30" width="95" bgcolor="#66ffff">#66FFFF</td><td height="30" width="95" bgcolor="#33ffff">#33FFFF</td><td height="30" width="95" bgcolor="#00ffff">#00FFFF</td><td height="30" width="95" bgcolor="#00dddd">#00DDDD</td><td height="30" width="95" bgcolor="#00aaaa">#00AAAA</td><td height="30" width="95" bgcolor="#008888">#008888</td></tr><tr><td height="30" width="95" bgcolor="#cceeff">#CCEEFF</td><td height="30" width="95" bgcolor="#77ddff">#77DDFF</td><td height="30" width="95" bgcolor="#33ccff">#33CCFF</td><td height="30" width="95" bgcolor="#00bbff">#00BBFF</td><td height="30" width="95" bgcolor="#009fcc">#009FCC</td><td height="30" width="95" bgcolor="#0088a8">#0088A8</td><td height="30" width="95" bgcolor="#007799">#007799</td></tr><tr><td height="30" width="95" bgcolor="#ccddff">#CCDDFF</td><td height="30" width="95" bgcolor="#99bbff">#99BBFF</td><td height="30" width="95" bgcolor="#5599ff">#5599FF</td><td height="30" width="95" bgcolor="#0066ff">#0066FF&nbsp;</td> <td height="30" width="95" bgcolor="#0044bb">#0044BB&nbsp;</td> <td height="30" width="95" bgcolor="#003c9d">#003C9D&nbsp;</td> <td height="30" width="95" bgcolor="#003377">#003377&nbsp;</td> </tr><tr><td height="30" width="95" bgcolor="#ccccff">#CCCCFF</td><td height="30" width="95" bgcolor="#9999ff">#9999FF</td><td height="30" width="95" bgcolor="#5555ff">#5555FF&nbsp;</td> <td height="30" width="95" bgcolor="#0000ff">#0000FF&nbsp;</td> <td height="30" width="95" bgcolor="#0000cc">#0000CC&nbsp;</td> <td height="30" width="95" bgcolor="#0000aa">#0000AA&nbsp;</td> <td height="30" width="95" bgcolor="#000088">#000088&nbsp;</td> </tr><tr><td height="30" width="95" bgcolor="#ccbbff">#CCBBFF</td><td height="30" width="95" bgcolor="#9f88ff">#9F88FF</td><td height="30" width="95" bgcolor="#7744ff">#7744FF&nbsp;</td> <td height="30" width="95" bgcolor="#5500ff">#5500FF&nbsp;</td> <td height="30" width="95" bgcolor="#4400cc">#4400CC&nbsp;</td> <td height="30" width="95" bgcolor="#2200aa">#2200AA&nbsp;</td> <td height="30" width="95" bgcolor="#220088">#220088&nbsp;</td> </tr><tr><td height="30" width="95" bgcolor="#7700ff">#7700FF&nbsp;</td><td height="30" width="95" bgcolor="#5500dd">#5500DD&nbsp;</td><td height="30" width="95" bgcolor="#4400b3">#4400B3&nbsp;</td><td height="30" width="95" bgcolor="#3a0088">#3A0088&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#e8ccff">#E8CCFF</td><td height="30" width="95" bgcolor="#d28eff">#D28EFF</td><td height="30" width="95" bgcolor="#b94fff">#B94FFF&nbsp;</td><td height="30" width="95" bgcolor="#9900ff">#9900FF&nbsp;</td><td height="30" width="95" bgcolor="#7700bb">#7700BB&nbsp;</td><td height="30" width="95" bgcolor="#66009d">#66009D&nbsp;</td><td height="30" width="95" bgcolor="#550088">#550088&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#f0bbff">#F0BBFF</td><td height="30" width="95" bgcolor="#e377ff">#E38EFF</td><td height="30" width="95" bgcolor="#d93eff">#E93EFF&nbsp;</td><td height="30" width="95" bgcolor="#cc00ff">#CC00FF&nbsp;</td><td height="30" width="95" bgcolor="#a500cc">#A500CC&nbsp;</td><td height="30" width="95" bgcolor="#7a0099">#7A0099&nbsp;</td><td height="30" width="95" bgcolor="#660077">#660077&nbsp;</td></tr><tr><td height="30" width="95" bgcolor="#ffb3ff">#FFB3FF</td><td height="30" width="95" bgcolor="#ff77ff">#FF77FF</td><td height="30" width="95" bgcolor="#ff3eff">#FF3EFF&nbsp;</td><td height="30" width="95" bgcolor="#ff00ff">#FF0&nbsp;0FF&nbsp;</td><td height="30" width="95" bgcolor="#cc00cc">#CC00CC&nbsp;</td><td height="30" width="95" bgcolor="#990099">#990099&nbsp;</td><td height="30" width="95" bgcolor="#770077">#770077&nbsp;</td></tr></tbody></table></p><p id="color_rgb">颜⾊还可以使⽤rgb(255,0,255)的⽅式</p><p id="color_pellucidity">使⽤rgba(255,0,255,0.6)最后⼀位设置透明度,取值0-1,</p></body></html>View Code注意:可使⽤复合属性font,设置字体相关属性值,不同属性值之间使⽤空格隔开。

css属性大全中文对照表

css属性大全中文对照表

css属性⼤全中⽂对照表Aalign-content 规定弹性容器内的⾏之间的对齐⽅式,当项⽬不使⽤所有可⽤空间时。

align-items 规定弹性容器内项⽬的对齐⽅式。

align-self 规定弹性容器内所选项⽬的对齐⽅式。

all 重置所有属性(除了 unicode-bidi 和 direction)。

animation 所有 animation-* 属性的简写属性。

animation-delay 规定开始动画的延迟。

animation-direction 规定动画是向前播放、向后播放还是交替播放。

animation-duration 规定动画完成⼀个周期应花费的时间。

animation-fill-mode 规定元素在不播放动画时(在开始之前、结束之后、或同时)的样式。

animation-iteration-count 规定动画的播放次数。

animation-name 规定 @keyframes 动画的名称。

animation-play-state 规定动画是播放还是暂停。

animation-timing-function 规定动画的速度曲线。

Bbackface-visibility 定义当⾯对⽤户时元素的背⾯是否应可见。

background 所有 background-* 属性的简写属性。

background-attachment 设置背景图像是与页⾯的其余部分⼀起滚动还是固定的。

background-blend-mode 规定每个背景图层(颜⾊/图像)的混合模式。

background-clip 定义背景(颜⾊或图像)应在元素内延伸的距离。

background-color 规定元素的背景⾊。

background-image 规定元素的⼀幅或多幅背景图像。

background-origin 规定背景图像的初始位置。

background-position 规定背景图像的位置。

background-repeat 设置是否以及如何重复背景图像。

CSS_style属性大全

CSS_style属性大全

CSS style属性大全显示:标签属性/属性行为集合事件滤镜方法对象样式一、标签属性属性描述ALIGN align 设置或获取表格排列。

ALLOWTRANSPARENCY allowTransparency 设置或获取对象是否可为透明。

APPLICATION APPLICATION 表明对象的内容是否为HTML 应用程序(HTA),以便免除浏览器安全模式。

ATOMICSELECTION 指定元素及其内容是否可以一不可见单位统一选择。

BEGIN begin 设置或获取时间线在该元素上播放前的延迟时间。

BORDER border 设置或获取框架间的空间,包括3D 边框。

canHaveChildren 获取表明对象是否可以包含子对象的值。

canHaveHTML 获取表明对象是否可以包含丰富的HTML 标签的值。

CLASS className 设置或获取对象的类。

contentWindow 获取指定的frame 或iframe 的window 对象。

DA TAFLD dataFld 设置或获取由dataSrc 属性指定的绑定到指定对象的给定数据源的字段。

DA TASRC dataSrc 设置或获取用于数据绑定的数据源。

disabled 获取表明用户是否可与该对象交互的值。

END end 设置或获取表明元素结束时间的值,或者元素设置为重复的简单持续终止时间。

firstChild 获取对象的childNodes 集合的第一个子对象的引用。

FRAMEBORDER frameBorder 设置或获取是否显示框架的边框。

hasMedia 获取一个表明元素是否为HTML+TIME 媒体元素的Boolean 值。

HEIGHT height 设置或获取对象的高度。

HIDEFOCUS hideFocus 设置或获取表明对象是否显式标明焦点的值。

HSPACE hspace 设置或获取对象的水平边距。

ID id 获取标识对象的字符串。

css教程菜鸟

css教程菜鸟

css教程菜鸟CSS(层叠样式表)是一种用于描述网页上的元素布局和样式的语言,它能够使网页更加美观和易于阅读。

本文将介绍一些CSS的基础知识和常用属性,以帮助菜鸟入门。

首先,让我们了解一下CSS的基本语法。

CSS由选择器和声明块组成。

选择器指定了要应用样式的HTML元素,而声明块则包含了一系列属性-值对,用于描述要应用到元素上的样式。

下面是一个简单的示例:```p {color: red;font-size: 20px;}```上述代码中,选择器“p”表示要应用样式的HTML段落元素。

声明块中的属性-值对指定了段落的文本颜色为红色,字体大小为20像素。

接下来,我们将介绍一些常用的CSS属性。

1. 字体属性:用于设置文本的字体样式,如字体大小、字体族等。

例如:```p {font-size: 16px;font-family: Arial, sans-serif;}```上述代码将段落的字体大小设置为16像素,字体族为Arial或者sans-serif。

2. 背景属性:用于设置元素的背景样式,如背景颜色、背景图片等。

例如:```body {background-color: lightblue;background-image: url("bg.jpg");}```上述代码将页面的背景颜色设置为浅蓝色,背景图片为名为“bg.jpg”的图片。

3. 边框属性:用于设置元素的边框样式,如边框宽度、边框颜色等。

例如:```div {border: 1px solid black;}```上述代码将`<div>`元素的边框宽度设置为1像素,边框颜色为黑色。

4. 盒模型属性:用于调整元素的尺寸和定位,如元素的宽度、高度、外边距等。

例如:```img {width: 200px;height: 150px;margin-top: 10px;}```上述代码将图片的宽度设置为200像素,高度设置为150像素,并且向上外边距10像素。

CSS常用样式属性大全

CSS常用样式属性大全

CSS常用样式属性大全1. 文本属性- `color`:设置文本颜色- `font-size`:设置字体大小- `font-family`:设置字体系列- `font-weight`:设置字体粗细- `text-align`:设置文本对齐方式- `text-decoration`:设置文本装饰(如下划线、删除线等)- `text-transform`:设置文本大小写转换2. 背景属性- `background-color`:设置背景颜色- `background-image`:设置背景图片- `background-repeat`:设置背景图片的重复方式- `background-position`:设置背景图片的位置- `background-size`:设置背景图片的尺寸3. 边框属性- `border`:设置元素边框样式、宽度和颜色- `border-radius`:设置元素边框的圆角- `border-color`:设置元素边框的颜色- `border-width`:设置元素边框的宽度4. 布局属性- `display`:设置元素的显示方式(如块级、内联等)- `width`:设置元素的宽度- `height`:设置元素的高度- `margin`:设置元素外边距- `padding`:设置元素内边距- `float`:设置元素的浮动方式5. 盒模型属性- `box-sizing`:设置元素的盒模型计算方式- `overflow`:设置元素溢出内容的处理方式- `position`:设置元素的定位方式- `top`:设置定位元素的上边距- `bottom`:设置定位元素的下边距- `left`:设置定位元素的左边距- `right`:设置定位元素的右边距以上是CSS中常用的样式属性,通过合理使用这些属性可以实现各种各样的页面效果。

在编写CSS代码时,建议将样式属性单独分行展示,以增加代码的可读性和维护性。

css属性大全

css属性大全

css属性大全CSS属性大全。

CSS(Cascading Style Sheets)是一种用来为网页添加样式和布局的样式表语言。

它可以控制网页的字体、颜色、间距、边框、背景等各种样式,是网页设计中不可或缺的一部分。

在这篇文档中,我们将详细介绍CSS中的各种属性,帮助您更好地掌握CSS的应用。

1. 字体属性。

字体属性用于设置网页中文本的字体样式、大小、粗细等。

常用的属性包括font-family(设置字体系列)、font-size(设置字体大小)、font-weight(设置字体粗细)、font-style(设置字体样式)等。

2. 文本属性。

文本属性用于设置文本的对齐方式、行高、间距等。

常用的属性包括text-align(设置文本对齐方式)、line-height(设置行高)、letter-spacing(设置字符间距)、word-spacing(设置单词间距)等。

3. 背景属性。

背景属性用于设置网页元素的背景样式。

常用的属性包括background-color(设置背景颜色)、background-image(设置背景图片)、background-repeat(设置背景重复方式)、background-position(设置背景位置)等。

4. 边框属性。

边框属性用于设置网页元素的边框样式。

常用的属性包括border-width(设置边框宽度)、border-style(设置边框样式)、border-color(设置边框颜色)、border-radius(设置边框圆角)等。

5. 盒模型属性。

盒模型属性用于设置网页元素的尺寸、内边距、外边距等。

常用的属性包括width(设置元素宽度)、height(设置元素高度)、padding(设置内边距)、margin(设置外边距)等。

6. 定位属性。

定位属性用于设置网页元素的位置。

常用的属性包括position(设置定位方式)、top(设置元素顶部位置)、left(设置元素左侧位置)、z-index(设置元素层级)等。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

CSS常用属性大全
2011-04-22 12:51
字体属性:(font)
大小 font-size: x-large;(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD
样式 font-style: oblique;(偏斜体) italic;(斜体) normal;(正常)行高 line-height: normal;(正常) 单位:PX、PD、EM
粗细 font-weight: bold;(粗体) lighter;(细体) normal;(正常)
变体 font-variant: small-caps;(小型大写字母) normal;(正常)
大小写 text-transform: capitalize;(首字母大写) uppercase;(大写) lowercase;(小写) none;(无)
修饰 text-decoration: underline;(下划线) overline;(上划线)
line-through;(删除线) blink;(闪烁)
字体投影效果:filter:dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1);
背景属性: (background)
色彩background-color: #FFFFFF;
图片background-image: url();
重复background-repeat: repeat; no-repeat; repeat-x; repeat-y;滚动background-attachment: fixed;(固定) scroll;(滚动)
位置background-position: left(水平) top(垂直);bottom; right; center;
简写方法 background:#000 url(..) repeat fixed left top;
区块属性: (Block)
字间距letter-spacing: normal; 数值
对齐text-align: justify;(两端对齐) left;(左对齐) right;(右对齐) center;(居中)
缩进text-indent: 数值px;
垂直对齐vertical-align: baseline;(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom;
单词间距word-spacing: normal; 数值
空格white-space: pre;(保留) nowrap;(不换行)
显示display:block;(块) inline;(内嵌) list-item;(列表项) run-in;(追加部分) compact;(紧凑) marker;(标记) table; inline-table; table-raw-group; table-header-group; table-footer-group; table-raw; table-column-group; table-column; table-cell; table-caption;(表格标题)
方框属性: (Box)
width:; height:; float:; clear:both; margin:; padding:; 顺序:上右下左
边框属性: (Border / border-top / border-right / border-bottom / border-left)
border-style: dotted;(点线) dashed;(虚线) solid; double;(双线) groove;(槽线) ridge;(脊状) inset;(凹陷) outset;
border-width:; 边框宽度
border-color:#;
简写方法border:width style color;
列表属性: (List-style)
类型list-style-type: disc;(圆点) circle;(圆圈) square;(方块) decimal;(数字) lower-roman;(小罗码数字) upper-roman; lower-alpha; upper-alpha;
位置list-style-position: outside;(外) inside;
图像list-style-image: url(..);
定位属性: (Position)
Position(定位): absolute(绝对); relative(相对);
static(静态);
visibility(可见性): inherit(继承); visible(可见);
hidden(隐藏);
overflow(溢出): visible(可见); hidden(隐藏); scroll(滚动); auto(自动);
clip(裁切): rect(12px,auto,12px,auto)
CSS连接属性:a:link (超链接格式); a:visited (浏览过的);
a:active (按下去的);a:hover(鼠标转到链接)
鼠标光标样式:(CURSOR:)
Hand 手指;crosshair十字体;s-resize箭头朝下;move十字箭头;move箭头朝右;help加一问号;w-resize箭头朝左;n- resize箭头朝上;ne-resize箭头朝右上;nw-resize箭头朝左上;text文字I型;se-resize箭头斜右下;sw- resize箭头斜左下;wait漏斗;p
{cursor:url("光标文件名.cur"),text;} 光标图案(IE6)
1、布局常用CSS命名:
warp/warpper 外套(整体布局) content 容器 main 页面主体
content/container 内容块
site 站点 layout 布局 column 栏 sidebar 侧栏 nav 导航
center 中 left 左 right 右
2、模块常用 CSS命名:
header 页头 footer 页脚 logo 标志 banner 广告
login 登录 loginbar 登录条 regsiter 注册 search 搜索
subnav 子导航 tab 标签页/标签 menu 菜单 submenu 子菜单
scroll 滚动 hot 热点 vote 投票 list 文章列表
news 新闻 download 下载 guide 指南 service 服务
joinus 加入 partner 合作伙伴 friendlink 友情链接 copyright 版权
shop 购物车(功能区) source 资源 map 网站地图 homepage 首页
3、导航常用CSS命名:
nav 导航外套 mainbav 主导航 subnav 子导航
sidebar 边导航 topnav 顶导航 sidebaricon 边导航图标
leftsidebar 左导航 rightsidebar 右导航 menucontainer 菜单容器 dropmunu 下拉菜单 menu 菜单 submenu 子菜单
4、类常用CSS命名: 
title 标题 summary 摘要 status 状态 spce 特别 scroll 滚动
label 标签 current 当前 msg 提示信息 tips 小技巧
submit 提交按钮 btn 按钮 icon 图标 note 注释
red 红色 textbox 文本框 drop 下拉 form 表单
breadcrumb 导航提示 crumb 导航 count 统计 cor/corner 转角/圆角5、文件常用命名:
master.css 主要文件 base.css 基本共用 layout.css 布局,版面
module.css 模块 themes.css 主题 columns.css 专栏
font.css 文字 mend.css 补丁 forms.css 表单 print.css 打印
6、hack速查:
屏蔽IE浏览器(也就是IE下不显示)
*:lang(zh) select {font:12px !important;} select:empty
{font:12px !important;} 这里select是选择符,根据情况更换。

第二句是MAC上safari浏览器独有的。

仅IE7与IE5.0可以识别 *+html select {…}
仅IE7可以识别 *+html select {…!important;}
IE6及IE6以下识别 * html select {…} 或html/**/ >body select {…}
仅IE6不识别 selct { display /*屏蔽IE6*/:none;}
仅IE6与IE5不识别 select/**/ { display /*IE6,IE5不识别*/:none;}仅IE5不识别,屏蔽IE5 select/*IE5不识别*/ {…}
PS:在css里控制每段开头自动空两格:p { text-indent: 2em;}。

相关文档
最新文档