css

一.css的引入方式
- 行内引入
- 内部引入
- 外部引入
二.css选择器
- 选择器的作用
// 找到特定的html页面元素(标签),把我们想要的标签选择出来


- id选择器和类选择器的区别
  1. 标签选择器
- 指用html标签名作为选择器,按标签名称分类,为页面中某一类标签指定同一的css样式
- 优点:能快速为页面中同类型的标签统一样式
- 缺点:不能设计差异化样式
  1. 类选择器
口诀:
    差异化选择
    一个或多个
    上面点定义
    类名别写错
    谁用谁调用
    
  1. id选择器
id选择器和类选择器区别在于使用次数上,id选择器只能调用一次,具有唯一性,在后边JavaScript使用较多
三、css字体样式属性调试工具
  1. font字体
- font-size 大小
- font-family 字体  可以写多个,用逗号隔开,
- font-weight 字体粗细
    //normal 正常,不加粗  normal=400
    //bold加粗
    //100-900整百的数字  700=bold  ,数字后边没有单位
- font-style 字体风格
    //italic 斜体
    //normal 正常
## 综合设置字体的格式:选择器{ font: font-style的值 font-weight值 font-size值 font-family值;} 顺序不能变化
## 其中font-size和font-family两个属性不能省略,其他的属性可以省略,否则font属性不生效
  1. css外观属性
- color文本颜色 red blue green
- line-height 行间距
- text-align 文本水平对齐方式
- text-index 行首缩进
- text-decoration 文本的装饰
When nothing seems to help, I go look at a stonecutter hammering away at his rock, perhaps a hundred times without as much as a crack showing in it. Yet at the hundred and first blow it will split in two, and I know it was not that blow that did it, but all that had gone before. -- Jacob Riis
原文地址:https://www.cnblogs.com/xhwy-1234/p/12209712.html