CSS样式

2020-03-09  本文已影响0人  琳媚儿

背景样式

背景颜色background-color

 背景图片background-image

 背景图片位置background-position

•   background-position:10px 100px;
•   背景图片定位的值是两个单位,分别代表坐标x,y轴

背景图片重复background-repeat
•   background-repeat:no-repeat
•   no-repeat 设置图像不重复,常用

 background缩写

• background:#ff0000 url(bg01.jpg) no-repeat fixed center#文本属性

文本属性

文本水平对齐方式text-align
文本所在行高的垂直对齐方式vertical-align
 文本缩进text-indent
•   text-indent:2em;
•   通常用在段落开始位置的首行缩进

 文本的装饰text-decoration
•   none 默认。
•   underline 下划线。
•   overline 上划线。
•   line-through 中线。

自动换行word-wrap    
• word-wrap: break-word;

基本样式

鼠标样式cursor

• 定义鼠标的样式cursor:pointer

– default默认

– pointer小手形状

– move移动形状
 透明度opacity

• opacity:0.3

• 透明度的值可以使0~1之间的数字,0代表透明,1代表完全不透明

 溢出隐藏  overflow
•   设置当对象的内容超过其指定高度及宽度时如何显示内容
•   visible 默认值,内容不会被修剪,会呈现在元素框之外。
•   hidden 内容会被修剪,并且其余内容是不可见的。
•   scroll 内容会被修剪,但是浏览器会显示滚动条以便查看其余的内容。
•   auto 如果内容被修剪,则浏览器会显示滚动条以便查看其余的内容。


浮动float

•   clear 清除浮动:
–   none : 不清除(默认值)。
–   left : 不允许左边有浮动对象
–   right : 不允许右边有浮动对象
–   both : 不允许两边有浮动对象

宽度:calc函数

width:calc(100%-80px);

图片模糊处理

 filter: blur(5px);
上一篇下一篇

猜你喜欢

热点阅读