CSS常用词汇

  • 黄楚恒
  • 2017-06-20 11:00:42
  • CSS
  • CSS
!important    显示优先级

颜色透明  { background-color:#000; opacity:0;filter:alpha(opacity=0); }

readonly="readonly" 只读

overflow: hidden; 超出隐藏

css图片放大
.content_top li a:hover img{
    transition:3s;//放大时间
    -webkit-transform:scale(1.2,1.2);//变大尺寸
    -moz-transform:scale(1.2,1.2);
    -transform:scale(1.2,1.2);
}

cursor: pointer; 改变光标

垂直居中:    display: table-cell;vertical-align: middle;

行级标签转换成块级标签:display:block;  块级转行级:display:inline   隐藏:display:none;

块级元素 block 如 div h1 p ul li等 会换行 想在同一行显示 需浮动或者display: inline
行级元素 inline 如 a span b 多个可以并排显示 默认设置宽度是不起作用 需设置 display: inline-block或者block才行。 

字体文本:
font-size         字体大小PX %
font-family       字体类型样式比如宋体字体
font-style:  normal、italic(斜体字)、oblique(倾斜)
font-weight:  bold(粗体)
font-variant:  设置小型大写字母字体  normal、small-caps(小型大写字母)、inherit(规定从父元素继承font-variant的值
letter-spacing:  设置字符间距
line-height:     设置文本行高
text-align :  设置段落 left | right | center | justify 
text-shadow:  应用于阴影文本  h-shadow(水平阴影位置)、vshadow(垂直阴影位置)、blur(模糊的距离)、color(阴影颜色)
text-decoration: 设置文本的修饰效果 (underline、overline、line-through)none(不装饰)
text-indent:     设置文本块首行缩进 (em)
text-transform:  控制文本的大小写  uppercase(大写)、lowercase(小写)、captitalize(首字母大写)
word-spacing:    设置单词间距

边框:
border-color            边框的颜色
border-width            边框的宽度
border-radius: 设置边框四边的圆角
border-style: dotted(点划线)、solid(实心线)、double(双划线)、dashed(虚线)
box-shadow: 设置一个或多个下拉阴影的框 h-shadow(水平阴影位置)、v-shadow(垂直阴影位置)、blur(模糊距离)、spread(阴影大小)
border-left-style: 设置左边框样式
border-left-width       边框的左边宽度

边距:
margin:   外边距 缩写:(上 右 下 左)/(上下  左右)/(上  左右  下)
padding:  内边距

背景:
background-attachment:设置背景图像是否固定或者随着页面的其余部分滚动,主要有fixed和scroll两个值
background-color         
background-image
background-position:  设置背景图像的开始位置。可以指定left和top等。
background-repeat:    设置是否及如何重复背景图像,主要有repeat、repeat-x、repeat-y、no-repeat

列表:
list-style
list-style-image:  将图象设置为列表项标记
list-position:     设置列表项标记的放置位置,主要有outside和inside两个值
list-style-type:   设置列表项标记的类型。
disc     实心圆
square 实心方块
none 不显示项目符号
decimal 阿拉伯数字
lower-roman 小写罗马数字
upper-alpha 大写英文字母
circle 空心圆

表格:
border-collapse:设置是否把表格边框合并为单一的边框
border-spacing: 设置分割单元格边框的距离
caption-side:   设置表格标题的位置
empty-cells:   设置是否示表格中的空单元格

链接样式:
a:link     超链接的普通样式
a:visited    被点击过的超链接样式
a:hover     鼠标指针经过超链接上时的样式
a:active     在超链接上单击时,既“当前激活”时超链接的样式
text-decoration:none  不显示下划线

渐变:
线性渐变(Linear Gradients)  background: linear-gradient(red, green);
径向渐变(Radial Gradients)  background: radial-gradient(red, blue);

过渡:
transition: property duration timing-function delay;
transition-property                指定CSS属性的name,transition效果
transition-duration                transition效果需要指定多少秒或毫秒才能完成
transition-delay                   定义transition效果开始的时候
 
transition-timing-function       指定transition效果的转速曲线 
  opacity:  设置对象的不透明度。  值被约束在[0.0-1.0]范围内

  z-index:  设置对象的层叠顺序。  属性参数值越大,则被层叠在最上面。

元素
display:inline;  可以把块状元素转行级

display:block;   可以把块行级素转块级

元素的浮动
属性用来控制元素是否浮动显示。
float : none | left | right 
float  
left    向左浮动
right 向右浮动

none 不浮动
清除浮动

clear : none | left | right | both 
none :默认值。允许两边都可以有浮动对象
left :不允许左边有浮动对象
right: 不允许右边有浮动对象
both :不允许有浮动对象

元素定位
position : static | absolute | fixed | relative

static :无定位,默认值

absolute:绝对定位

脱离文档流。
通过 top,bottom,left,right 定位。
如果父元素 position 为 static 时,将以body坐标原点进行定位。
如果父元素 position 为 relative  时,将以父元素进行定位。
relative :相对定位
不脱离文档流
参考自身静态位置通过 top,bottom,left,right 定位。

fixed:固定定位
固定定位实际上只是绝对定位的特殊形式;固定定位的元素是相对于浏览器窗口而固定,而不是相对于其包含元素;即使页面滚动了,它们仍然会处在浏览器窗口中跟原来完全一样的地方。

实线   border:2px solid;
圆角
border-radius:25px;

Copyright © 2016-2019 709173702@qq.com 版权所有  ICP证粤ICP备16117826号-1
联系邮箱:709173702@qq.com