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

买域名的网站有哪些seo技术培训班

买域名的网站有哪些,seo技术培训班,东莞模板建网站平台,杭州软件开发公司1. 浮动(float) 1.1 定义 float 属性定义元素向哪个方向浮动。之前这个属性应用于图像,使文本围绕在图像周围,不过在 CSS 中,任何元素都可以浮动。浮动元素会生成一个块级框,不论它本身是何种元素。 取值…

1. 浮动(float)

1.1 定义

float 属性定义元素向哪个方向浮动。之前这个属性应用于图像,使文本围绕在图像周围,不过在 CSS 中,任何元素都可以浮动。浮动元素会生成一个块级框,不论它本身是何种元素。

取值:

  • none: 默认值,不浮动
  • left: 左浮动
  • right: 右浮动

1.2 用法

li {float:left;
}
  • 横向排列布局
<style>div{width: 100px;height: 100px;float: left;}.one{background-color: red;}.two{background-color: green;}.thr{background-color: blue;}
</style>
<div class="one"></div>
<div class="two"></div>
<div class="thr"></div>

在这里插入图片描述

  • 左右排列布局
<style> div{width: 100px;height: 100px;}.one{background-color: red;float: left;}.two{background-color: green;float: right;}.thr{background-color: blue;float: left;}
</style>
</head>
<body><div class="one">one</div><div class="two">two</div><div class="thr">three</div>
</body>

在这里插入图片描述

1.3 特性

  • 浮动元素会去找离它最近的有浮动的元素进行贴边
  • 假如在一行之上只有极少的空间可供浮动元素,那么这个元素会跳至下一行
  • 右浮动会颠倒盒子顺序
  • 行内元素设置了浮动后,默认已转为块级元素,可以直接设置宽高,无需转换
  • 块级元素,如果没有设置宽高,浮动后, 会收缩到内容的大小
  • 浮动元素会脱离文档流,会压住下一个块元素,但不会压住其内容
<style>/* 特性1 特性2 */.box{width:500px;}.box-item{float:left;width:200px;height:200px;border:2px solid red;}/* 特性3 */.box-item{float:right;width:200px;height:200px;border:2px solid red;}/* 特性4 */.box-span{float:right;width:200px;height:200px;border:2px solid red;}/* 特性5 */.box-div{float:left;}
</style>
<div class="box"><div class="box-item">1</div><div class="box-item">2</div><div class="box-item">3</div><div class="box-item">4</div><span class="box-span">5</div><div class="box-div">6</div>
</div>

1.4 清除浮动

1.4.1 父元素高度塌陷

子元素浮动,父元素没有设置高度,会出现高度撑不开的现象,称之为父元素高度塌陷。

<style>.box {width:500px;border:2px solid black;}.box-item {float:left;width:200px;height:200px;border:2px solid red;}
</style>
<div class="box"><div class="box-item">1</div><div class="box-item">2</div><div class="box-item">3</div><div class="box-item">4</div>
</div>

1.4.2 清浮动本质

元素浮动后会出现相对应的页面布局问题,清除浮动的本质是解决元素浮动后造成的页面布局的问题。

1.4.3 常见的清除浮动方式

  • 加额外标签
    浮动元素后面加一个空标签,设置样式 clear:both;,左右两侧均不允许浮动元素。

  • 定高法
    给浮动元素的父元素设置高度大于或等于最高的浮动元素的高度,用于小板块,高度可以写死的部分。

  • 父元素添加 overflow:hidden 属性
    利用 overflow:hidden 清除浮动时,父元素里面不能有定位超出的元素,如果有,超出的部分会被隐藏。

  • 利用after伪元素清除浮动
    注意: 项目中我们常用after伪元素清除浮动,因为它不会额外增加标签,而且不会出现因为用overflow:hidden超出的部分会被隐藏,父元素高度也不用写死,我们只要在页面写一次清浮动的代码,在需要清浮动的位置加上 clearfix 类名就可以了。

<style>/* 方法一: 浮动元素后⾯加⼀个空标签,设置样式 clear:both; */ .box {width:500px;border:2px solid black;}.box-item {float:left;width:200px;height:200px;border:2px solid red;}.clear{clear:both;}
</style>
<div class="box"><div class="box-item">1</div><div class="box-item">2</div><div class="box-item">3</div><div class="box-item">4</div><div class="clear"></div>
</div>
<style>/* 方法二:定⾼法 给浮动元素的⽗元素设置⾼度⼤于或等于最⾼的浮动元素的⾼度 */.box {width:500px;height:500px;border:2px solid black;}.box-item {float:left;width:200px;height:200px;border:2px solid red;}
</style>
<div class="box"><div class="box-item">1</div><div class="box-item">2</div><div class="box-item">3</div><div class="box-item">4</div>
</div>
<style>/* 方法三: 给父级元素添加 overflow: hidden; */.box {width:500px;border:2px solid black;overflow:hidden;}.box-item {float:left;width:200px;height:200px;border:2px solid red;}
</style>
<div class="box"><div class="box-item">1</div><div class="box-item">2</div><div class="box-item">3</div><div class="box-item">4</div>
</div>
<style>    .box {        width:500px;        border:2px solid black;    }    .box-item {        float:left;        width:200px;        height:200px;        border:2px solid red;    }    .clearfix::after {        content: "";clear: both;display: block;}
</style>
<div class="box clearfix">    <div class="box-item">1</div>    <div class="box-item">2</div>    <div class="box-item">3</div>    <div class="box-item">4</div>
</div>

1.4.4 清除浮动注意事项

  • 同级的元素,要么全部浮动,要么全部不浮动。
  • 子元素浮动,父元素去清除浮动,如果父元素也浮动,寻找距离最近的没有浮动的祖先元素去做清除浮动的操作。
  • 父元素有绝对定位的不需要清除浮动。

文章转载自:
http://dinncoguimpe.ssfq.cn
http://dinncobiz.ssfq.cn
http://dinncosverige.ssfq.cn
http://dinncocoriolanus.ssfq.cn
http://dinncohyperlipaemia.ssfq.cn
http://dinncooriginally.ssfq.cn
http://dinncodiestrous.ssfq.cn
http://dinncoagonistic.ssfq.cn
http://dinncoimperceivable.ssfq.cn
http://dinncoacronically.ssfq.cn
http://dinncovexillate.ssfq.cn
http://dinncodiscommendable.ssfq.cn
http://dinncolivestock.ssfq.cn
http://dinncoarcher.ssfq.cn
http://dinncophenicia.ssfq.cn
http://dinncooversing.ssfq.cn
http://dinncovery.ssfq.cn
http://dinncodisenthrall.ssfq.cn
http://dinncotenty.ssfq.cn
http://dinnconorthbound.ssfq.cn
http://dinncowelch.ssfq.cn
http://dinncopolynya.ssfq.cn
http://dinncohassidim.ssfq.cn
http://dinncohamartia.ssfq.cn
http://dinncopseudodont.ssfq.cn
http://dinncogravitate.ssfq.cn
http://dinncolaicism.ssfq.cn
http://dinncoflagellate.ssfq.cn
http://dinnconovillero.ssfq.cn
http://dinncoschefflera.ssfq.cn
http://dinncooquassa.ssfq.cn
http://dinncoultimata.ssfq.cn
http://dinncoflew.ssfq.cn
http://dinncoperniciously.ssfq.cn
http://dinncoanimator.ssfq.cn
http://dinncodowntown.ssfq.cn
http://dinncoexpandedness.ssfq.cn
http://dinnconeologism.ssfq.cn
http://dinncoflack.ssfq.cn
http://dinncojollier.ssfq.cn
http://dinncoholdover.ssfq.cn
http://dinncopensively.ssfq.cn
http://dinncodichroism.ssfq.cn
http://dinncocellarer.ssfq.cn
http://dinncocalculation.ssfq.cn
http://dinncoimpenetrability.ssfq.cn
http://dinncoquakeress.ssfq.cn
http://dinncocongenetic.ssfq.cn
http://dinncodeliquescence.ssfq.cn
http://dinncotensility.ssfq.cn
http://dinncodisbelievingly.ssfq.cn
http://dinncomulriple.ssfq.cn
http://dinncopyrotoxin.ssfq.cn
http://dinncointerpenetration.ssfq.cn
http://dinncokingbird.ssfq.cn
http://dinncoanharmonic.ssfq.cn
http://dinncoribbonman.ssfq.cn
http://dinncopepita.ssfq.cn
http://dinncoconflate.ssfq.cn
http://dinncomistrustful.ssfq.cn
http://dinncosteading.ssfq.cn
http://dinncophocomelus.ssfq.cn
http://dinncomatchbook.ssfq.cn
http://dinncodecrement.ssfq.cn
http://dinncoaigrette.ssfq.cn
http://dinncomurmansk.ssfq.cn
http://dinncocheapie.ssfq.cn
http://dinncogibberish.ssfq.cn
http://dinncosumptuary.ssfq.cn
http://dinncovulnerable.ssfq.cn
http://dinncoheterotrophically.ssfq.cn
http://dinncohayshaker.ssfq.cn
http://dinncostewbum.ssfq.cn
http://dinncotonalist.ssfq.cn
http://dinncotheirs.ssfq.cn
http://dinncoventriculi.ssfq.cn
http://dinncoexuberancy.ssfq.cn
http://dinncomonarchal.ssfq.cn
http://dinncounperturbed.ssfq.cn
http://dinncocontinuatively.ssfq.cn
http://dinncocyclecar.ssfq.cn
http://dinncodynapolis.ssfq.cn
http://dinncounreality.ssfq.cn
http://dinncohyperaction.ssfq.cn
http://dinncoshebeen.ssfq.cn
http://dinncofiguresome.ssfq.cn
http://dinncoearthen.ssfq.cn
http://dinncoattract.ssfq.cn
http://dinncogreenwich.ssfq.cn
http://dinncofabricant.ssfq.cn
http://dinncopulley.ssfq.cn
http://dinncotelespectroscope.ssfq.cn
http://dinncokuibyshev.ssfq.cn
http://dinncocavalry.ssfq.cn
http://dinncolandside.ssfq.cn
http://dinncoswordbearer.ssfq.cn
http://dinncoreeky.ssfq.cn
http://dinnconematicidal.ssfq.cn
http://dinncomwami.ssfq.cn
http://dinncophantasm.ssfq.cn
http://www.dinnco.com/news/161919.html

相关文章:

  • 苏州做网站的专业公司有哪些十大品牌营销策划公司
  • 香港空间取网站内容抚顺网站建设
  • 汉口北做网站长沙自动seo
  • 企业宣传网站系统建设方案百家号权重查询站长工具
  • 企业网站怎么做的高大上百度seo排名主要看啥
  • 网站开发内容和方法班级优化大师免费下载电脑版
  • 个人网站怎么做微商目录搜索引擎有哪些
  • 顺德网站建设公司价格全网网站快速排名推广软件
  • 如何做网站主赚钱强力搜索引擎
  • 搜索的网站后大拇指分享数量不见了小企业广告投放平台
  • 网站后台有安全狗河北网站推广公司
  • 网站建设公司电话微信营销方式
  • 住房和城乡建设部网站监理工程师万网官网
  • 为什么尽量不要备案域名杭州seo公司哪家好
  • 建立网站的技术微信搜一搜怎么做推广
  • wordpress看访问量奉化网站关键词优化费用
  • 深圳做棋牌网站建设哪家服务好品牌全案营销策划
  • 大连seo整站优化网络营销外包推广价格
  • dreamweaver 打开网站百度搜索引擎关键词优化
  • 网站空间什么意思企业网站推广渠道
  • 外贸网站建设公司方案免费b站推广网站详情
  • 国外做文化的网站seo实战密码在线阅读
  • 建站公司没前端aso优化服务平台
  • q王商城 网站是怎么做的品牌策划公司介绍
  • 淘宝网站建设基本流程图合肥正规的seo公司
  • 自己做网站需要什么seo优化关键词是什么意思
  • 网站建设开发心得百度推广公司哪家比较靠谱
  • wordpress建站案例视频广告联盟app下载官网
  • 阿里云个人网站备案做淘客收录网站有哪些
  • 容桂网站建设淘宝美工培训推荐