CSS 浅谈篇、绝对有你想要

WBOY
Release: 2016-07-06 13:28:24
Original
1076 people have browsed it

本章内容:

  • 简介
    1. CSS 定义
    2. 四种引入方式
    3. 样式应用的顺序
  • 选择器(Selector)
    1. * 通用元素选择器
    2. 标签选择器
    3. class 类选择器
    4. # ID选择器
    5. , 多元素选择器
    6.  后代元素选择器
    7. > 子元素选择器
    8. + 毗邻元素选择器
    9. [] 属性选择器
    10. 伪类选择器
  • 常用属性
    1. 颜色属性(color 、transparent、opacity)
    2. 字体属性(font-style、 font-weight、font-size、 font-family、font)
    3. 文本属性(white-space、direction、text-align、line-height、vertical-align、text-indent、letter-spacing、word-spacing、 text-transform、text-overflow、text-decoration、text-shadow、word-wrap)
    4. 背景属性(background-color、background-image、background-position、background-repeat、background-attachment、background)
    5. 列表属性(list-style-type、list-style-image、list-style-position、list-style)
  • 页面布局
    1. 边框(border-style、border-color、border-width、border-radius、border、box-shadow)
    2. 盒子模型(padding、margin)
    3. display
    4. visibility
    5. float 浮动
    6. clip 剪裁图像
    7. overflow  设置当对象的内容超过其指定高度及宽度时如何显示内容
    8. position 规定元素的定位类型(static、relative、absolute、fixed)
    9. z-index  元素层叠顺序
    10. outline 边框轮廓
    11. zoom 缩放比例 
    12. cursor 鼠标的类型形状(Crosshair、Pointer、Move、text、wait、help...)
    13. transform、transition 动画效果

 

简介

CSS 是什么?

        CSS是Cascading Style Sheets的简称,中文称为层叠样式表。

        属性和属性值用冒号隔开,以分号结尾。

 

CSS 四种引入方式:

1.行内式

          行内式是在标签的style属性中设定CSS样式。

    <div style="..."></div>
Copy after login

2.嵌入式

嵌入式是将CSS样式集中写在网页的标签的标签对中。

<head>
    ...
    <style type="text/css">
        ...此处写CSS样式
    </style>
</head>
Copy after login

3.导入式
将一个独立的.css文件引入HTML文件中,导入式使用@import 引入外部CSS文件,