htm&css 颜色的浮动
目标样式

目标分析:
由图可知,整个色板可以分为三块
可以理解为一个大的盒子包含了三个小的盒子,定义如下

LEFT的定义方式

TOP的定义方式

class为bottom的块最为复杂,但分析方法也是异曲同工,因此不要担心太难。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=div, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="../css/color.css">
</head>
<body>
<div class="all">
<div class="left">
<div></div>
<div></div>
<div></div>
</div>
<div class="top">
<div class="top_1"></div>
<div class="top_2">
<div></div>
<div></div>
</div>
</div>
<div class="bottom">
<div class="bottom_1"></div>
<div class="bottom_2">
<div></div>
<div></div>
<div></div>
</div>
<div class="bottom_3">
<div class="con1"></div>
<div class="con2">
<div></div>
<div></div>
</div>
</div>
</div>
</div> <div></div>
<div></div>
<div></div>
</body>
</html>
color.html
*{
margin: 0;
padding: 0;
}
.all{
width: 600px;
height: 600px;
border: 1px dotted red;
position: relative;
top: 50px;
left: 300px;
}
.left{
width: 150px;
height: 600px;
float: left;
}
.left div:nth-child(1){
height: 200px;
width: 150px;
background: #cccccc;
}
.left div:nth-child(2){
height: 300px;
width: 150px;
background: #d40000;
}
.left div:nth-child(3){
height: 100px;
background: #24e712;
}
/*toptoptoptop*/
.top{
width: 450px;
height: 150px;
float: left;
}
.top_1{
width: 300px;
height: 150px;
background: yellow;
float: left;
}
.top_2{
width: 150px;
height: 150px;
float: left;
}
.top_2 div:nth-child(1){
width: 149px;
height: 80px;
background: #24e712;
float: right;
}
.top_2 div:nth-child(2){
width: 149px;
height: 70px;
background: #04fdb3;
float: right;
}
.bottom{
width: 450px;
height: 450px;
float: left;
}
.bottom_1{
width: 100px;
height: 450px;
background: purple;
float: left;
}
.bottom_2{
height: 450px;
width: 150px;
float: left;
background: red;
}
.bottom_2 div:nth-child(1){
width: 150px;
height: 200px;
background: red;
}
.bottom_2 div:nth-child(2){
width: 150px;
height: 100px;
background: rgb(0, 0, 0);
}
.bottom_2 div:nth-child(3){
width: 150px;
height: 150px;
background: rgb(190, 255, 12);
}
.bottom_3{
width: 200px;
height: 450px;
float: left;
}
.con1{
width: 200px;
height: 200px;
background: #24e712;
}
.con2{
width: 200px;
height: 250px;
}
.con2 div:nth-child(1){
width: 200px;
height: 100px;
background: #04fdb3;
}
.con2 div:nth-child(2){
width: 200px;
height: 150px;
background: green;
}
color.css
最终样式

htm&css 颜色的浮动的更多相关文章
- CSS盒子的浮动
web前端学习笔记(CSS盒子的浮动) 在标准流中,一个块级元素在水平方向会自动伸展,直到包含它的元素的边界:而在竖直方向和兄弟元素依次排列,不能并排.使用“浮动”方式后,块级元素的表现就会有所不同. ...
- css颜色属性及设置颜色的地方
css颜色属性 在css中用color属性规定文本的颜色. 默认值是not specified 有继承性,在javascript中语法是object.style.color="#FF0000 ...
- CSS颜色及文本字体
CSS颜色及文本字体 CSS颜色表示法 CSS文本设置 CSS边框属性 背景属性 元素溢出 CSS颜色及文本字体 CSS颜色表示法 颜色名表示,比如:red 红色,yellow黄色,pick粉色 16 ...
- 【CSS进阶】CSS 颜色体系详解
说到 CSS 颜色,相比大家都不会陌生,本文是我个人对 CSS 颜色体系的一个系统总结与学习,分享给大家. 先用一张图直观的感受一下与 CSS 颜色相关大概覆盖了哪些内容. 接下来的行文内容大概会按照 ...
- CSS颜色代码
颜色值 CSS 颜色使用组合了红绿蓝颜色值 (RGB) 的十六进制 (hex) 表示法进行定义.对光源进行设置的最低值可以是 0(十六进制 00).最高值是 255(十六进制 FF).从 0 到 25 ...
- CSS clear清除浮动
1.CSS中的clear有四个参数: none:允许两边都可以浮动. left:不允许左边有浮动. right:不允许右边有浮动. both(默认):不允许有浮动. 2.一开始在CSS中clear浮动 ...
- 第 14 章 CSS 颜色与度量单位
学习要点: 1.颜色表方案 2.度量单位 主讲教师:李炎恢 本章主要探讨 HTML5 中 CSS 颜色和度量单位等问题,包括颜色的选取方式.相对长度和绝对长度等. 一.颜色表方案 颜色的表现形式主要有 ...
- CSS中的浮动和定位
在了解CSS中的浮动和定位之前有必要先了解清楚标准流和脱离标准流的特性 标准流的默认特性 1.分行.块级元素,并且能够dispay转换. 2.块级元素(block):默认独占一行,不能并列显示,能够设 ...
- CSS 颜色代码大全
CSS颜色: 转载:http://www.cnblogs.com/axing/archive/2011/04/09/CSS.html
随机推荐
- 02 Python学习笔记-基本数据类型(二)
一.基本知识 1.缩进: 2.一行多条语句: 3.断行: 4.注释 # 单行注释 '''这是一段 多行注释''' 5. 变量 1. 变量类型(局部变量.全局变量.系统变量) 2. 变量赋值 多重赋值x ...
- JVM学习记录3--垃圾收集器
贴个图 Serial收集器 最简单的收集器,单线程,收集器会暂停用户线程,称为"stop the world". ParNew收集器 Serial收集器的多线程版本,其它类似.默认 ...
- expect实现自动输入密码功能
系统: Ubuntu:16.04 安装expect: sudo apt-get update sudo apt-get install expect 脚本实例: //这一行告诉操作系统脚本里的代码使用 ...
- 深度学习框架Tensorflow应用(Google工程师)
首先在这里给大家分享Google工程师亲授 Tensorflow2.0-入门到进阶教程 有需要的小伙伴可点击进入扣群下载,群内不定期的会分享资料教程,点击直达链接:https://jq.qq.com/ ...
- Java 基本数据类型的取值范围
基本数据类型,字节数,位数,最大值和最小值. 1. 基本类型:short 二进制位数:16 包装类:java.lang.Short 最小值:Short.MIN_VALUE=-32768 (-2的15此 ...
- spark java api数据分析实战
1 spark关键包 <!--spark--> <dependency> <groupId>fakepath</groupId> <artifac ...
- 「考试」 Or
不得不说是一道多项式神题了. 虽然说颓代码颓的很厉害不过最终A掉了. 好好讲一讲这道题. 涉及的知识点是:高阶导数,NTT,指数型母函数,泰勒公式,以及意志力和数学推导能力. 那就开始了. 一个测试点 ...
- CSPS模拟 43
我这次把考试题改完了 T1 A 发现S*b必须和T模a同余? 貌似乘不了几次就爆T了?可以暴力? 也许乘的越多越好? 内心:切了 另外怎么设置鼠标指到黑块上边就显示字那种东西 最后当然是因为低错没有A ...
- 「CF630C」Lucky Numbers
更好的阅读体验 Portal Portal1: Codeforces Portal2: Luogu Description The numbers of all offices in the new ...
- MapReduce任务提交源码分析
为了测试MapReduce提交的详细流程.需要在提交这一步打上断点: F7进入方法: 进入submit方法: 注意这个connect方法,它在连接谁呢?我们知道,Driver是作为客户端存在的,那么客 ...