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

CSS浮动(一)---Float

1.浮动模型也是一种可视化格式模型,浮动的框可以左右移动。直到它的外边缘碰到包含框或者另一个浮动元素的框的边缘。浮动元素不在文档的普通流中,文档的普通流中的元素表现的就像浮动元素不存在一样。

不浮动 
<div style="border: solid 5px #0e0; width:300px;">
        <div style="height: 100px; width: 100px; background-color: Red;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Green; ">
        </div>
        <div style="height: 100px; width: 100px; background-color: Yellow;">
        </div>
    </div>

  

//红框左移,覆盖绿框 
<div style="border: solid 5px #0e0; width:300px;">
        <div style="height: 100px; width: 100px; background-color: Red;  float:left;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Green;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Yellow;">
        </div>
    </div>

  

如果包含块儿太窄无法容纳水平排列的三个浮动元素,那么其它浮动块儿向下移动,,直到有足够的扣减,如果浮动元素的高度不同,那么下下移动的时候可能被卡住

没有足够水平空间  
<div style="border: solid 5px #0e0; width:250px;">
        <div style="height: 100px; width: 100px; background-color: Red;  float:left;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Green;  float:left;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Yellow;  float:left;">
        </div>
    </div>

  

卡住了
<div style="border: solid 5px #0e0; width:250px;">
        <div style="height: 120px; width: 100px; background-color: Red;  float:left;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Green;  float:left;">
        </div>
        <div style="height: 100px; width: 100px; background-color: Yellow;  float:left;">
        </div>
    </div>

  

 

转载于:https://www.cnblogs.com/moxuexiaotong/p/10070844.html

相关文章:

  • mode_w
  • war包
  • Js获取操作系统版本 获得浏览器版本
  • [USACO12MAR]摩天大楼里的奶牛Cows in a Skyscraper
  • Alpha阶段个人总结
  • BZOJ5091: [Lydsy1711月赛]摘苹果【期望DP】
  • RDIFramework.NET V3.3 Web版新增报表管理功能模块-重量级实用功能
  • /etc/skel 目录作用
  • [逆向工程] 二进制拆弹Binary Bombs 快乐拆弹 详解
  • 软工 · BETA 版冲刺前准备(团队)
  • [源码和文档分享]基于C语言的PL0编译器
  • 图-连通性-有向图的强连通分量
  • 第四次作业
  • 简单的课程管理系统
  • 钉钉:自定义机器人
  • CSS选择器——伪元素选择器之处理父元素高度及外边距溢出
  • ECMAScript入门(七)--Module语法
  • github指令
  • iOS高仿微信项目、阴影圆角渐变色效果、卡片动画、波浪动画、路由框架等源码...
  • JavaScript标准库系列——Math对象和Date对象(二)
  • PAT A1050
  • React+TypeScript入门
  • sessionStorage和localStorage
  • windows下mongoDB的环境配置
  • 当SetTimeout遇到了字符串
  • 读懂package.json -- 依赖管理
  • 官方新出的 Kotlin 扩展库 KTX,到底帮你干了什么?
  • 精益 React 学习指南 (Lean React)- 1.5 React 与 DOM
  • 排序算法之--选择排序
  • 世界上最简单的无等待算法(getAndIncrement)
  • #git 撤消对文件的更改
  • $ is not function   和JQUERY 命名 冲突的解说 Jquer问题 (
  • (初研) Sentence-embedding fine-tune notebook
  • (附源码)python旅游推荐系统 毕业设计 250623
  • (附源码)springboot优课在线教学系统 毕业设计 081251
  • (九)信息融合方式简介
  • (欧拉)openEuler系统添加网卡文件配置流程、(欧拉)openEuler系统手动配置ipv6地址流程、(欧拉)openEuler系统网络管理说明
  • (数位dp) 算法竞赛入门到进阶 书本题集
  • (原创)攻击方式学习之(4) - 拒绝服务(DOS/DDOS/DRDOS)
  • (转)项目管理杂谈-我所期望的新人
  • ***利用Ms05002溢出找“肉鸡
  • .bat文件调用java类的main方法
  • .net 7 上传文件踩坑
  • .net core开源商城系统源码,支持可视化布局小程序
  • .net 获取url的方法
  • .NET中使用Redis (二)
  • .skip() 和 .only() 的使用
  • .vue文件怎么使用_vue调试工具vue-devtools的安装
  • @RunWith注解作用
  • [ 英语 ] 马斯克抱水槽“入主”推特总部中那句 Let that sink in 到底是什么梗?
  • [C#]winform利用seetaface6实现C#人脸检测活体检测口罩检测年龄预测性别判断眼睛状态检测
  • [ESP32] 编码旋钮驱动
  • [GN] 设计模式——面向对象设计原则概述
  • [halcon案例2] 足球场的提取和射影变换
  • [hdu1561] The more, The Better 【树形DP】