Heim  >  Artikel  >  Web-Frontend  >  css中应该滚瓜烂熟的属性_html/css_WEB-ITnose

css中应该滚瓜烂熟的属性_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:14:121117Durchsuche

Text

  • color 设置text的颜色
  • text-align 设置text的对齐
  • text-decoration 设置text的下划线
  • text-transformation 设置字母的大小写和单词的首字母大写
  • line-height 设置行高
  • letter-spacing 设置字符间的距离
  • Font

  • font-family 设置字体
  • font-size 设置字体的大小
  • font-style 设置字体为斜体还是正常显示
  • font-weight 加粗字体
  • Background

  • background-color 设置背景的颜色
  • background-image 设置背景图片
  • background-repeat 设置背景图片的重复方式
  • background-position 设置背景图片的位置 默认为top left
  • Lists

  • list-style-type 设置list的类型,有circle等值
  • box-model

  • margin 设置盒子的外边距 外边距是透明的。
  • padding 设置盒子的内边距 内边距也是透明的。
  • border 设置盒子的边框,边框为不透明的。note:边框必须要设置类型,否则将无效。
  • float 设置盒子的浮动,浮动是绝对定位的一种,其占位空间将消失。
  • clear 清除盒子的浮动,清除封装的那个盒子的浮动。
  • position and :after / :before

  • :after 和 :before 通常都是和position一起使用的。position分为绝对定位和相对定位,相对定位的空间还在,绝对定位的空间就不在了。那两个伪类+ position的绝对定位,由非常强大的威力,很多地方都可以用。比如微信的小红点消息通知。
  • CSS3

  • border-radius css3支持设置圆角
    -webkit-border-radius 支持webkit的浏览器
    -moz-border-radius: 支持moz的浏览器
    Syntax:提供一个半径即可。
  • box-shadow css3支持设置阴影
    -webkit-box-shadow
    -moz-box-shadow
    Syntax-shadow: none|h-shadow v-shadow blur spread color |inset|initial|inherit;

  • text-shadow css3 支持设置text阴影
    Syntax-shadow: h-shadow v-shadow blur-radius color|none|initial|inherit;

  • Multiple Backgrounds css3的背景图支持多张背景图

  • ** background-size** css3支持背景的尺寸
  • text-overflow css3 支持对超出边界的文字的处理
    Syntax:
    text-overflow: clip|ellipsis|string|initial|inherit;

  • Flexible Box Model

  • transform 分为2d和3d 主要包括缩放、平移和旋转。
  • 未完待续......

    Stellungnahme:
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn