HTML_CSS学习:浮动

一、浮动简介

相关代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>浮动_简介</title><style>div{width: 600px;height: 400px;background-color: #1c80d9;}img{float: right;/*margin-right: 0.5em;*/}.test::first-letter{font-size: 80px;float: left;}</style>
</head>
<body><div><img src="../pictures/喜羊羊.jpg" alt="" style="width: 200px;height: auto;">lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quodlorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.lorem ipsum dolor sit amet, consectetur adipisicing elit. Quisquam, quod.</div><hr><div class="test">The quick brown fox jumps over the lazy dog, while the eager beaver builds a sturdy dam and the proud peacock displays its vibrant plumage. A clever crow steals a shiny ring from the sleeping cat, as the noisy crowders chatter in the bustling city square. The brave knight slays the fearsome dragon with his trusty sword, and the joyful children play in the sunny meadow. The graceful swan glides on the serene lake, while the mischievous monkey swings from tree to tree. The diligent bee collects nectar from the colorful flowers, as the majestic eagle soars high in the clear blue sky. The talented artist captures the beauty of nature on her canvas, and the wise owl watches over the peaceful forest. The ambitious entrepreneur launches a successful startup, while the skillful chef prepares a delicious feast for the hungry guests. The curious kitten explores its new surroundings, as the faithful dog guards its owner’s home.</div></body>
</html>

显示结果:

二、元素浮动后的特点

相关代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>元素浮动后的特点</title><style>.outer{width: 800px;height: 400px;padding: 10px;background-color: #5dcd2d;text-align: center;}.box{font-size: 20px;padding: 10px;}.box1{background-color: red;}.box2{background-color: blue;float: left;/*width: 200px;*//*height: 200px;*/}.box3{background-color: yellow;float: left;}</style>
</head>
<body><div class="outer"><div class = "box box1">盒子1</div><div class = "box box2">盒子2</div><div class = "box box3">盒子3</div></div></body>
</html>

显示结果:

三、浮动小练习

相关代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>浮动小练习</title><style>.outer{width: 500px;background-color: #47c447;border: 1px solid black;}.box{width: 200px;height: 200px;background-color: red;border: 1px solid black;margin: 10px;float: left;}.box1{height: 230px;}/*.box1{*//*    float: left;*//*}*/</style>
</head>
<body><div class="outer"><div class = "box box1">1</div><div class = "box box2">2</div><div class = "box box3">3</div></div><div style="background-color: #999ff0">The quick brown fox jumps over the lazy dog, while the eager beaver builds a sturdy dam and the proud peacock displays its vibrant plumage. A clever crow steals a shiny ring from the sleeping cat, as the noisy crowders chatter in the bustling city square. The brave knight slays the fearsome dragon with his trusty sword, and the joyful children play in the sunny meadow. </div></body>
</html>

显示结果:

四、浮动后的影响

相关代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>浮动后的影响</title><style>.outer{width: 500px;background-color: #47c447;border: 1px solid black;}.box{width: 100px;height: 100px;background-color: red;border: 1px solid black;margin: 10px;/*float: left;*/}.box1,.box2,.box3{float: left;}</style>
</head>
<body><div class="outer"><div class="box box0">0</div><div class="box box1">1</div><div class="box box2">2</div><div class="box box3">3</div>
<!--        <div class="box box4">4</div>--></div>
<!--    <div style="background-color: #999ff0">The quick brown fox jumps over the lazy dog, while the eager beaver builds a sturdy dam and the proud peacock displays its vibrant plumage. A clever crow steals a shiny ring from the sleeping cat, as the noisy crowders chatter in the bustling city square. The brave knight slays the fearsome dragon with his trusty sword, and the joyful children play in the sunny meadow. The graceful swan glides on the serene lake, while the mischievous monkey swings from tree to tree. The diligent bee collects nectar from the colorful flowers, as the majestic eagle soars high in the clear blue sky. The talented artist captures the beauty of nature on her canvas, and the wise owl watches over the peaceful forest. The ambitious entrepreneur launches a successful startup, while the skillful chef prepares a delicious feast for the hungry guests. The curious kitten explores its new surroundings, as the faithful dog guards its owner’s home. The powerful ocean waves crash against the rocky shore, and the gentle breeze whispers through the leaves of the ancient trees. The adventurous traveler explores remote villages in search of hidden treasures, while the playful dolphin leaps through the waves of the vast ocean. </div>--></body>
</html>

显示结果:

五、解决浮动后的影响

相关代码:

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>解决浮动后的影响</title><style>.outer{width: 500px;background-color: #47c447;border: 1px solid black;/*第一种解决方案*//*height: 122px;*//*第二种解决方案*//*float: left;*//*第三种解决方案*//*overflow: scroll;*/}.box{width: 100px;height: 100px;background-color: red;border: 1px solid black;margin: 10px;/*float: left;*/}.box1,.box2,.box3,.box4{float: left;}/*.box4{*//*    !*display: inline-block;*!*//*    !*height: 260px;*!*//*    !*clear: left;*!*//*    display: inline;*//*    clear: both;*//*    !*消除左侧浮动兄弟带来的影响*!*//*}*/.box5{clear:both;}.mofa{/*第四种*/clear: both;}.outer::after{content: '';display: block;clear: both;}</style>
</head>
<body><div class="outer">
<!--        <div class="box box0">0</div>--><div class="box box1">1</div><div class="box box2">2</div><div class="box box3">3</div><div class="box box4">4</div><div class="box box5">5</div>
<!--        <div class="box box5">5</div>-->
<!--        <div class="mofa"></div>--></div><div style="background-color: #999ff0">The quick brown fox jumps over the lazy dog, while the eager beaver builds a sturdy dam and the proud peacock displays its vibrant plumage. A clever crow steals a shiny ring from the sleeping cat, as the noisy crowders chatter in the bustling city square. The brave knight slays the fearsome dragon with his trusty sword, and the joyful children play in the sunny meadow. The graceful swan glides on the serene lake, while the mischievous monkey swings from tree to tree. The diligent bee collects nectar from the colorful flowers, as the majestic eagle soars high in the clear blue sky. The talented artist captures the beauty of nature on her canvas, and the wise owl watches over the peaceful forest. The ambitious entrepreneur launches a successful startup, while the skillful chef prepares a delicious feast for the hungry guests. The curious kitten explores its new surroundings, as the faithful dog guards its owner’s home. The powerful ocean waves crash against the rocky shore, and the gentle breeze whispers through the leaves of the ancient trees. The adventurous traveler explores remote villages in search of hidden treasures, while the playful dolphin leaps through the waves of the vast ocean. </div></body>
</html>

显示结果:

六、浮动布局小练习

相关代码:

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><title>浮动布局小练习</title><style>*{margin: 0;padding: 0;}.leftfix{float: left;}.rightfix{float: right;}.clearfix::after{content: '';display: block;clear: both;}.container{width: 960px;margin: 0 auto;text-align: center;}.logo{width: 200px;}.banner1{width: 540px;/*margin-left: 20px;*//*margin-right: 20px;*/margin: 0 10px;}.banner2{width: 200px;}.logo,.banner1,.banner2{height: 80px;line-height: 80px;background-color: #c9c9c9;}.meun{height: 30px;background-color: #c9c9c9;margin-top: 10px;}.item1,.item2{width: 368px;height: 198px;line-height: 198px;border: 1px solid #000;margin-right: 10px;}.content{margin-top: 10px;}.item3,.item4,.item5,.item6{width: 178px;height: 198px;line-height: 198px;border: 1px solid #000;margin-right: 10px;}.bottom{margin-top: 10px;}.item7,.item8,.item9{width: 198px;height: 128px;line-height: 128px;border: 1px solid #000;}.item8{margin: 10px 0;}.footer{height: 60px;background-color: #c9c9c9;line-height: 60px;margin-top: 10px;}</style>
</head>
<body><div class="container">
<!--        头部--><div class="page-header clearfix"><div class="logo leftfix">logo</div><div class="banner1 leftfix">banner1</div><div class="banner2 leftfix">banner2</div></div>
<!--        菜单--><div class="meun">菜单</div>
<!--        内容区--><div class="content clearfix"><div class="left leftfix">
<!--                上--><div class="top clearfix"><div class="item1 leftfix">栏目一</div><div class="item2 leftfix">栏目二</div></div>
<!--                下--><div class="bottom"><div class="item3 leftfix">栏目三</div><div class="item4 leftfix">栏目四</div><div class="item5 leftfix">栏目五</div><div class="item6 leftfix">栏目六</div></div></div><div class="right rightfix"><div class="item7">栏目七</div><div class="item8">栏目八</div><div class="item9">栏目九</div></div></div>
<!--        页脚--><div class="footer">页脚</div></div></body>
</html>

显示结果:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/1411580.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

【b站vue教程】1 宏观视角下的浏览器——前端大厂面试必刷:前后端必学的网络安全浏览器工作原理:从入门到精通全套【附带所有源码】

课程地址&#xff1a;【前端大厂面试必刷&#xff1a;前后端必学的网络安全浏览器工作原理&#xff1a;从入门到精通全套【附带所有源码】】 https://www.bilibili.com/video/BV1UL41157hP/?share_sourcecopy_web&vd_sourceb1cb921b73fe3808550eaf2224d1c155 目录 1、宏…

c#学习基础1

一、复杂数据类型 1&#xff09;概述 2&#xff09;枚举 1.基本概念 枚举是一个比较特别的存在&#xff0c;它是一个被命名的整形常量的集合&#xff0c;一般用它来表示状态&#xff0c;类型等 1.1申明枚举和申明枚举变量 1.2申明枚举语法 2.在哪里申明枚举 3.枚举的使用 4…

3GPP官网下载协议步骤

1.打开官网 https://www.3gpp.org/ 2.点击 3.在界面选择要找的series&#xff0c;跳转到查找界面 以V2X通信协议为例&#xff0c;论文中通常会看到许多应用&#xff1a; [7] “Study on evaluation methodology of new Vehicle-to-Everything (V2X) use cases for LTE and NR…

频率和转速转换功能块(CODESYS ST源代码)

1、转速和频率转换功能块 转速和频率转换功能块(CODESYS ST源代码)-CSDN博客文章浏览阅读10次。1、转速/频率常用转换关系转速/频率/线速度/角速度计算FC_200 plc计算角速度-CSDN博客文章浏览阅读3.2k次。https://rxxw-control.blog.csdn.net/article/details/138438864 1、转…

java注解浅述

Java 5之后可以在源代码中嵌入一些补充信息&#xff0c;这种补充信息称为注解&#xff08;Annotation&#xff09;。注解并不能改变程序运行的结果&#xff0c;不会影响程序运行的性能。有些注解可以在编译时给用户提示或警告&#xff0c;有的注解可以在运行时读写字节码文件信…

商务分析方法与工具(一):Python的趣味快捷-运算符、表达式与内置对象

Tips&#xff1a;"分享是快乐的源泉&#x1f4a7;&#xff0c;在我的博客里&#xff0c;不仅有知识的海洋&#x1f30a;&#xff0c;还有满满的正能量加持&#x1f4aa;&#xff0c;快来和我一起分享这份快乐吧&#x1f60a;&#xff01; 喜欢我的博客的话&#xff0c;记得…

C++:二叉搜索树的底层模拟实现

概念&#xff1a; 二叉搜索树又称二叉排序树&#xff0c;它或者是一棵空树&#xff0c;或者是具有以下性质的二叉树&#xff1a; 搜索二叉树的操作&#xff1a; int a[] {8, 3, 1, 10, 6, 4, 7, 14, 13};二叉搜索树需要满足左子树比根小&#xff0c;右子树比根大&#xff0c;…

无人机+集群组网:无人机无线组网巡检方案

随着无人机技术的快速发展&#xff0c;其在各种巡检场景中的应用日益广泛。无人机能够快速部署、灵活飞行&#xff0c;并且搭载多种传感器设备&#xff0c;为巡检工作提供了全新的视角和手段。然而&#xff0c;单一的无人机作业受限于通信距离和覆盖范围&#xff0c;难以满足大…

匹配网络(Matching Networks)和原型网络(Prototypical Networks):区别详解

匹配网络&#xff08;Matching Networks&#xff09;和原型网络&#xff08;Prototypical Networks&#xff09; 匹配网络与原型网络&#xff1a;区别详解匹配网络&#xff08;Matching Networks&#xff09;核心特点&#xff1a;应用场景&#xff1a; 原型网络&#xff08;Pro…

HTML_CSS学习:CSS盒子模型

一、CSS中常用的长度单位 相关代码&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>CSS中常用的长度单位</title><style>html{font-size: 40px;}#d1{/*第一种长度单位&…

Web端重叠路径可视化

近几年来&#xff0c;由于信息技术的发展&#xff0c;大数据成为了这个时代的代名词之一&#xff0c;“数据可视化”风靡一时。得益于HTML5提供的新标签“canvas”&#xff0c;Web端也能分“数据可视化”一杯羹。 随着越来越多的可视化方案和需求&#xff0c;需要解决问题也越来…

Redis-三主三从高可用集群搭建

正式搭建之前&#xff0c;注意事项&#xff08;坑&#xff09;提前放到最开始&#xff0c;也可以出问题回来看&#xff0c; &#xff08;1&#xff09;第二步中最好将配置文件中的logfile自定义一个目录&#xff0c;以便于在第五步中启动出错的时候迅速定位错误。 &#xff0…

Qt_介绍_环境安装_创建新项目_实现helloworld_坐标_1

文章目录 一、Qt是什么二、Qt的发展史三、Qt支持的平台四、Qt版本五、Qt的优点六、Qt的应用场景七、Qt开发环境&#xff0c;需要按照3个部分1.C编译器&#xff08;gcc,cl.exe....不是Visual Studio&#xff09;2.Qt SDK3.需要有一个Qt的集成开发环境&#xff08;IDE&#xff09…

不尝试一下?计算机领域两大赛事来了!!

前言 最近&#xff0c;熊二新来的同事小强比较关注国内的一些赛事信息。这不&#xff0c;近期有两大赛事。这两大赛事&#xff0c;主要还是面向高校学生的。一个是搞网络安全方向的: 第二届京麒CTF挑战赛&#xff0c;另一个是搞数据库方向的: 2024年全国大学生计算机系统能力大…

指令寻址——顺序寻址、跳跃寻址

目录 一、概述 1.定义 2.寻址方式分类 3.形式地址、物理地址 二、指令寻址 1、顺序寻址方式 2、跳跃寻址方式 一、概述 1.定义 寻址方式解决的是指如何在指令中表示一个操作数的地址&#xff0c;如何用这种表示得到操作数、或怎样计算出操作数的地址。 2.寻址方式分类…

题目:方格取数[Easy]

问题描述&#xff1a; 解题思路&#xff1a; 可以使用动态规划&#xff0c;建立dp[i][j][x]&#xff0c;表示&#xff08;1&#xff0c;1&#xff09;到&#xff08;i&#xff0c;j&#xff09;且其积的余数为x的情况下的方案数。时间复杂度为(n^2) * k。 AC代码&#xff1a; …

C语言/数据结构——每日一题(移除链表元素)

一.前言 今天在leetcode刷到了一道关于单链表的题。想着和大家分享一下。废话不多说&#xff0c;让我们开始今天的知识分享吧。 二.正文 1.1题目要求 1.2思路剖析 我们可以创建一个新的单链表&#xff0c;然后通过对原单链表的遍历&#xff0c;将数据不等于val的节点移到新…

RateLimiter 限流 —— 通过切面对单个用户进行限流和黑名单处理

关于登录的安全性管理有较多的手段&#xff0c;包括&#xff1b;设备信息、IP信息、绑定的信息、验证码登各类方式。不过在一些网页版的登录中&#xff0c;如果有人想办法把你的验证码给我&#xff0c;我就可以登录你的账户&#xff0c;查看你的数据。对于一些不法分子通过让你…

【系统架构师】-选择题(十一)

1、紧耦合多机系统一般通过&#xff08;共享内存&#xff09;实现多机间的通信。对称多处理器结构&#xff08;SMP&#xff09;属于&#xff08; 紧耦合&#xff09;系统。 松耦合多机系统又称间接耦合系统,—般是通过通道或通信线路实现计算机间的互连。 2、采用微内核的OS结构…

数据库基础--MySQL多表查询之联表查询

联表查询 定义&#xff1a;多张表联合在一起查询&#xff0c;例如学生信息与学生班级表、部门与员工表 创建两张表&#xff0c;主表与从表 CREATE TABLE TestMain(id INT Not NULL AUTO_INCREMENT,nameVARCHAR(10),introduction VARCHAR(255),PRIMARY KEY(id) ); CREATE TAB…