css入门002

css文本属性

  • letter-spacing 字母间距 默认0px
  • word-spacing 单词间距 默认0px
  • text-decoration 值:none/underline/line=through
  • text-align 水平对齐方式
  • vertical-align 垂直对齐方式(基于文字的基线) baseline/bottom/top/ middlle/sub/super/text-top/text-bottom/百分比
  • text-indent 首行缩进 长度单位
  • line-height:行高(行高需合并到font中) 长度单位 设置行高=高 使一行文字垂直居中(两行间基线的距离)
  • font:[style/variant/weight] size/line-height family(直接写属性)

css背景属性

  • background-color 背景颜色
  • backgroung-image 背景图片 url()
  • background-repeat 背景图片的平铺方式 repeat(默认)/repeat-x/repeat-y/no-repeat
  • background-position 背景图片定位 left/center/right/长度单位 top/center/bottom/长度单位(background-position: center(x) center(y); )
  • background:color image repeat position

css边框属性

  • border-width 边框的宽度 长度单位
  • border-color
  • border-style 边框线的风格 solid/dotted/dashed/double...
  • border:width style color
  • border-left/right/top/bottom

css鼠标光标属性

  • cursor 值 default/pointer/move/crosshair/text/wait

css列表属性

  • list-style-type 列表项的图形 disc/circle/square/decimal/lower-roman/upper-roman...
  • list-style-image 自定义列表图形 url
  • * list-style-postion 列表项图形的位置 outside/inside
  • 最常见的设置 list-style:none

css表格属性

  • table-layout 表格布局方式 auto/fixed
  • border-collapse 合并单元格边框 separte/collapse
  • border-spacing 单元格间距 长度单位
  • caption-side 表格标题的位置 top/bottom
  • empty-cells 没有内容的单元格是否隐藏 show/hide

css sprites css精灵图

div+css布局

行内元素和块状元素

  • 块状元素独占一行,行内元素可以共用一行
  • 默认宽度:块状元素默认宽度有父元素决定 行内元素默认宽度由内容决定
  • 块状元素可以设置宽高,行内元素不可以设置宽高
  • 大部分块状元素内部可以嵌套块状或行内元素,大部分行内元素只能嵌套在行内
  • 块状元素可以设置外边距,行内元素只能设置外边距的左右
  • 块状元素与行内元素的互换:
    • 块转为行:display:inline
    • 行转为块:display:block
    • 转换为行内块状元素:display:inline-block

块状:

  • <ol>
  • <ul>
  • <dl>
  • <table>
  • <h1>...<h6>
  • <p>
    • <blockquote>
    • <dt>
    • <address>
    • <caption>
    • <div>

内联(行内):

  • a - 锚点  
  • abbr - 缩写 
  • br 换行 
  • cite - 引用 
  • dfn- 定义字段  
  • em - 强调  
  • font - 字体设定(不推荐)  
  • img - 图片  
  • input - 输入框 
  • label - 表格标签 
  • q - 短引用 
  • select - 项目选择 
  • small - 小字体文本 
  • span - 常用内联容器,定义文本内区块
  • strong - 粗体强调 
  • textarea - 多行文本输入框

font background border均用来统一设置某些属性但font要注意顺序关系其他两个可以不用注意顺序

原文地址:https://www.cnblogs.com/zgh929/p/7247664.html