1.css的基本构成


  • 样式选择器

  • id选择器

  • 元素选择器

2.css的盒模型

  • border

  • padding

  • margin

3.Atom快捷键

4.程序

(1)初始程序

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Learn css with blocks</title>
<link rel="stylesheet" href="block.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div class="block-1">

</div> <div class="block-2">

</div> <div class="block-2">

</div> </body>
</html>
.block-1{

}

.block-2{

}

.block-3{

}

  (2)border外边框

.block-1{
border: solid 2px blue; #实体
} .block-2{
border: dotted 2px blue; #锯齿
} .block-3{
border: solid 2px blue;
}

  (3)backgroud:背景颜色

.block-1{
border: solid 2px blue;
background: tomato
} .block-2{
border: dotted 2px blue;
background: green
} .block-3{
border: solid 2px blue;
background: rgb(115, 232, 165)
}

   (4)margin 外攘.注意分号;

  margin:20px;

margin-bottom: 20px;

  (5)padding 内推

  padding: 0 0 0 20px;

  (6) 如何让主目录大小固定?

  •   box-sizing: border-box;

    

  box-sizing: border-box;
width: 256px;
height: 64px;

5.完整程序

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Learn css with blocks</title>
<link rel="stylesheet" href="block.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div class="block-1">

</div> <div class="block-2">

</div> <div class="block-3">

</div> </body>
</html>
.block-1{
border: solid 2px blue;
margin:20px;
padding: 0 0 0 20px; background: tomato
} .block-2{
border: dotted 2px blue;
margin:20px;
padding: 0 0 0 20px; background: green
} .block-3{
border: solid 2px blue;
margin:20px;
padding: 0 0 0 20px; background: rgb(115, 232, 165)
}

    

最新文章

  1. 关于PB调用Microsoft Web Browser控件的一些问题
  2. 虚拟机启动linux系统报错,此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态
  3. 关于CSS reset
  4. 使用 SharedPreferences 实现数据的存储和读取
  5. Servlet课程0425(五) sendRedirect实现不同页面共享数据
  6. 用lsb_release -a 查看linux版本
  7. android: WheelView组件(滑轮组件)的应用!
  8. 转:JDK中的URLConnection参数详解
  9. Android - &quot;cause failed to find target android-14&quot; 问题
  10. ABP架构学习系列二:ABP中配置的注册和初始化
  11. [js高手之路] vue系列教程 - vue的基本用法与常见指令(1)
  12. Mac上安装Appium简介
  13. Hbase各版本环境要求
  14. [luogu5004]专心OI - 跳房子【矩阵加速+动态规划】
  15. MybatisPlus使用介绍
  16. egret获取本周,上周,今天,昨天,明天,现在时间,今年,本月
  17. mybatis 转义
  18. Bagging-Adaboost-RF的粗糙理解
  19. react-native android打包
  20. 为在python中使用dotnet程序安装clr

热门文章

  1. Windows server R2 2008上部署gogs git
  2. 浏览器中使用calc不识别
  3. simotion读写CF卡,保存/读取变量
  4. 快速提取邮箱地址(利用word或网站)
  5. 反射java
  6. react里面引入图片
  7. ios视图层次结构
  8. 第33章 TIM—电容按键检测—零死角玩转STM32-F429系列
  9. (转)ActionContext和ServletActionContext
  10. python的模块