CSS笔记

CSS层叠样式表:
1.基本选择器:标记选择器、.类别选择器、#ID
2.行内样式、内嵌式<style type="text/css"></style>、链接式<link href="" type="text/css" rel="stylesheet">、
    导入式 略
    优先级:后面的样式会覆盖前面的样式
4.padding 内容到块边界距离
 margin 块之间距离

5.交集、并集加','、后代加' '、直接后代选择器加'>'
6.继承特性、层叠特性:行内样式>ID 样式>类别样式>标记样式


7.字体font-family:Arial;font-family:黑体,宋体
  文字倾斜font-style:italic
  文字加粗font-weight:bold/normal
  英文字母大小写转化text-transform:首字母大写capitalize/全部大写uppercase/全部小写lowercase
  文字大小font-size
  文字装饰text-decoration下划线underline/删除线line-through/上划线overline
  段落首行缩进text-indent:2em
  字词间距word-spacing letter-spacing
  文字行高line-heigh:1.2
  段落之间的距离margin padding
  文本水平位置text-align:left/right/center/justify
  文字颜色color背景颜色background-color
  段落的垂直对齐方式
  <div class="greenBorder" style="display: table; height: 400px; #position: relative; overflow: hidden;">
    <div style=" #position: absolute; #top: 50%;display: table-cell; vertical-align: middle;">
      <div class="greenBorder" style=" #position: relative; #top: -50%">
        any text<br>
        any height<br>
        any content, for example generated from DB<br>
        everything is vertically centered
      </div>
    </div>
  </div>
   
  
8.盒模型border padding margin
9.块级元素竖直排列<div>、行内元素左右排列<span>
10.Position 属性:默认static按照标准流来定位
  Relative相对定位,Absolute绝对定位,Fixed固定定位
11.Z-index 空间位置,默认是 0,z-index 值大的页面位于其值小的上方
12.Display:Inline把元素变成内联元素
        /:Block把元素变成块级元素


13.Border:设置表格边框
 Border-collapse:separate边框分离/collapse合并
 Border-spacing :设置单元格的间距
 Padding:设置单元格内容和边框之间的距离
 Table-layout:auto根据单元格的内容自动调整宽度/fixed表格宽度固定


14.链接的四种状态
 a:link普通的、未被访问的链接/visited用户已访问的链接/hover鼠标指针位于链接的上方/active链接被点击的时刻
 按钮式超链接

15.列表符号list-style-type、list-style-image
16.css布局:head、content、side、foot
 Relative相对定位,Absolute绝对定位

 

posted @ 2019-04-21 22:31  不走捷径  阅读(88)  评论(0编辑  收藏  举报