当前位置: 首页 > news >正文

浮动练习(1)

要求呈现图案:

法一:不建议
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title> </title><style>div:nth-child(1){width: 100px;height: 100px;background-color: aqua ;float: left;}div:nth-child(2){width: 300px;height: 100px;background-color: purple ;}div:nth-child(3){width: 100px;height: 200px;background-color: gold ;float: left;}div:nth-child(4){width: 100px;height: 200px;background-color: red ;float: left;}div:nth-child(5){width: 300px;height: 100px;background-color: black ;}div:nth-child(6){width: 300px;height:100px;background-color: palegoldenrod ;}</style> </head><body><div></div><div></div><div></div><div></div><div></div><div></div>  </body>
</html>法二:建议用此方法
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><title></title><style>.container{width: 300px;height: 300px;background-color: gray;}.container .top{width: 300px;height: 100px;background-color: blue;}.container .bottom{width: 300px;height: 200px;background-color: purple;}.container .top .left{width: 100px;height: 100px;background-color: red;}.container .bottom .left{width: 100px;height: 200px;background-color: yellow;float: left;}.container .bottom .center{width: 100px;height: 200px;background-color: pink;float: left;}.container .bottom .right{width: 100px;height: 200px;background-color: green;float: left;}.container .bottom .right .top{width: 100px;height: 100px;background-color: gold;    }.container .bottom .right .bottom{width: 100px;height: 100px;background-color: greenyellow;}</style>
</head>
<body><div class="container"><div class="top"><div class="left"></div></div><div class="bottom"><div class="left"></div><div class="center"></div><div class="right"><div class="top"></div><div class="bottom"></div></div></div>            </div>
</body>
</html>


http://www.mrgr.cn/news/53919.html

相关文章:

  • Planetoid(helpers.dataset_classes文件中的classic_datasets.py)
  • [笔记] 关于CreateProcessWithLogonW函数创建进程
  • 测试教程分享
  • SQL-SERVER导入excel表格
  • Ubuntu下解决python程序首次连接mysql拒绝访问之总结
  • 算法笔记day05
  • Vue3学习:vite项目中图片不能显示,报错 require is not defined
  • 《计算机视觉》—— 表情识别
  • UML图画法(动态图):用例图(Use Case Diagram)
  • 高级语言源程序转换为可执行目标文件
  • Leetcode - 周赛419
  • HTB:Bashed[WriteUP]
  • 下载nltk数据
  • 详细尝鲜flutter
  • 递归神经网络(RNN)简介
  • MySQL查看当前客户端连接数的方法
  • NOIP2007年复赛
  • 【北京迅为】《STM32MP157开发板嵌入式开发指南》- 第五十四章 Pinctrl 子系统和 GPIO 子系统
  • D-PAD论文解析
  • 虚拟机nacos部署报错数据源未设置问题解决方案
  • 逻辑之舞:C++ 内存分配与释放,在程序的舞台上,演绎着资源的分配与回收
  • 解决SolidWorks装配体无法更改透明度问题
  • 【数据结构】栈
  • 数仓建设:如何设计数据治理考评规则?
  • 类和对象(中)后面部分
  • 【note】GNN