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
随机推荐
- C# WPF基础巩固
时间如流水,只能流去不流回. 学历代表你的过去,能力代表你的现在,学习能力代表你的将来. 学无止境,精益求精. 一.写作目的 做C# WPF开发,无论是工作中即将使用,还是只应付跳槽面试,开发基础是非 ...
- 小白学 Python(10):基础数据结构(列表)(下)
人生苦短,我选Python 前文传送门 小白学 Python(1):开篇 小白学 Python(2):基础数据类型(上) 小白学 Python(3):基础数据类型(下) 小白学 Python(4):变 ...
- 论RSA算法的重要性 -RSA 简介
地球上最重要的算法 (这个说法似乎有点夸张了,但是当你了解了RSA算法后,就觉得不夸张了.) 如果没有 RSA 算法,现在的网络世界毫无安全可言,也不可能有现在的网上交易.上一篇文章 ssh 协议为什 ...
- gym102302E_Chi's performance
题意 给n个二元组(v,p),要求排序使得v从小到大,而且总价值最大,价值定义为相邻两个v值不同的p值之差绝对值之和. 分析 in a row原来是相邻的意思. 对于每个相同v值的块来说,有用的数只有 ...
- [tesseract-ocr]OCR图像识别Ubuntu下环境包安装
问题: ImportError: libSM.so.6: cannot open shared object file: No such file or directory 解决: sudo apt- ...
- loadrunner常用web动作函数
web_custom_request ---允许使用任何http请求方法 脚本一: web_custom_request("baidu_request","URL=ht ...
- 爬虫之selenium爬取京东商品信息
import json import time from selenium import webdriver """ 发送请求 1.1生成driver对象 2.1窗口最大 ...
- [考试反思]1104csp-s模拟测试100: 终结
这么好的整数场,就终结了我连续莫名考好的记录. 功德圆满了... 还是炸了啊.而且炸的还挺厉害(自己又上不去自己粘的榜单啦) 说实在的这场考试做的非常差劲.虽说分数不算特别低但是表现是真的特别差. T ...
- ie浏览器兼容性的入门解决方案
IE浏览器的兼容性素来是令人头疼的问题,大名鼎鼎的FUCK-IE不是浪得虚名的. 这里使用的解决方案是HACK,具体原理就是针对不同的浏览器写不同的HTML.CSS样式,从而使各种浏览器达到一致的渲染 ...
- git 生成密匙时遇到报错 :Too many arguments.
今天在我用新电脑想要向github上的远程库上传项目时,由于新电脑上的本地库没有与远程库建立连接,所以要在本地生成密匙添加到github上才可以上传,在我执行命令 ssh-keygen -t rsa- ...