05day

作者: 小胡123 | 来源:发表于2018-10-21 22:56 被阅读0次

文档流

将窗口自上而下分成一行行,在每行中从左向右的顺序排放元素,即为文档流。
文档流中元素默认会紧贴到上一个元素右边,若不足以放下会另起一行
块元素在文档流高度由内容撑开的

浮动

display:inlineblock;
块元素脱离文档流:,在父元素中浮动起来。
宽度占父元素100% 块独占一行
float:none;(默认)
float:left;(左浮动) 给一个设浮动后,会脱离文档流,不占位,下面的顶上
float:right;(右浮动)覆盖文字,会环绕
浮动比文档流高一层
浮动元素不会超过文档流,最多一边齐
浮动元素不会

内联元素脱离文档流变成块
块元素脱离文档流display:inline后仍是块元素。
块元素和行内元素·都可以浮动,一个行内元素浮动以后自动变为块元素。

项目布局

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>唯品会</title>
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<body>
<div class='a'>
<div class='b'>
<div class='c'></div>
<div class='d'></div>
</div>
</div>
<div class='e'>
<div class='f'>
<div class='g'>
<img src="img/123.png" alt='logo' width='160px' />
<img src="img/345.png" alt='bao' width='302.97px'/>
</div>
<div class='h'></div>
</div>
</div>
<div class='i'>
<div class='j'></div>
</div>
<div class='k'>
<div class='l'>
<div class='m'></div>
<div class='n'></div>
</div>
</div>
<div class='bikanqu'>
<img src="img/678.jpg" alt='bikan' width='1170px' />
<div class='zhong'>
<div class='tpp'>
<img src="img/789.jpg" alt='tpp' width='240px' />
<img src="img/789.jpg" alt='tpp' width='240px' />
<img src="img/789.jpg" alt='tpp' width='240px' />
<div class='shu'>
<div class='o'>
<img src="img/112.jpg" alt='weipin' width='360px' />
</div>
<div class='p'>
<img src="img/112.jpg" alt='weipin' width='360px' />
</div>
</div>
</div>
</div>
<img src="img/223.jpg" alt="huawei" width='1170px' />
</div>
</body>
</html>
样式:
.a{
width: 100%;
height: 28px;
background-color: #f5f5f5;
}
.b{
width: 1000px;
height: 28px;
background-color: white;
margin:0 auto;
}
.c{
width: 86px;
height: 28px;
background-color: green;
float:left;
}
.d{
width: 771px;
height: 28px;
background-color: yellow;
float:right;
}
.e{
width: 100%;
height: 100px;
background-color: #fff;
}

.f{
width: 1000px;
height: 100%;
background-color: orange;
margin:0 auto;
}
.g{
float:left;
}
.h{
width: 480px;
height: 33.97px;
background-color: blue;
/display:inline-block;/
float:right;
margin-top: 33px;
/vertical-align: top;/
}
.i{
width: 100%;
height: 42.99px;
background-color: #fff;
}
.j{
width: 1000px;
height: 100%;
background-color: red;
margin:0 auto;
}
.k{
width: 100%;
height: 501.99px;
background-color: purple;
border-top: 1px red solid;
}
.l{
width: 1167.97px;
height: 451.99px;
background-color: green;
margin:0 auto;
}
.m{
width: 1145.99px;
height: 400px;
background-color: black;
margin:0 auto;
border:10px white solid;
border-bottom: none;
margin-top: 30px;
}
.n{
width: 1145.99px;
height: 40px;
background-color: yellow;
margin:0 auto;
border:10px white solid;
border-top: none;
border-bottom: none;
}
.bikanqu{
width: 1579.17px;
height: 540px;
background-color: white;
margin-top: 20px;
margin:0 auto;
}
.zhong{
width: 1400px;
margin:0 auto;
}
.bikan{
margin:0 auto;
}
.tpp{
margin-top: 20px;
float:left;
}
.shu{
float:right;
}
.p{
margin-top: 27px;
}
/.sousuo{
width: 448.997px;
height: 31.992px;
background-color: black;
float:right;
/
margin-top: 34px;
/display:inline-block;/
/vertical-align: top;/

/.sousuo input{
width: 335px;
height: 26px;
}
/

.content{
width: 100%;
height: 400px;
background-color:yellow;
}
.footer{
width: 200px;
height: 100px;
background-color:blue;
}*/

相关文章

  • 05day

    BFC (隐含的属性)1 父元素的垂直外边距不会和元素重叠2 开启BFC的元素不会被浮动元素所覆盖的3 开启BFC...

  • 05day

    文档流 将窗口自上而下分成一行行,在每行中从左向右的顺序排放元素,即为文档流。文档流中元素默认会紧贴到上一个元素右...

  • mysql 05day

    mysql的基本命令

  • mysql(05day)

    1.排序ASC: 升序,默认的情况下就是升序DESC: 如果要降序,指明为DESC 2.单列排序SELECT * ...

  • 网页05day

    定位:position属性可以控制Web浏览器如何以 及在何处显示特定的元素。可以使用position属性把一个元...

  • 前端05day

    **em标签用于表示一段内容中的着重点。**strong标签用于表示一个内容的重要性。...

  • 前端05day

    相对定位 绝对定位 固定定位 CSS高度塌陷 高度塌陷问题 在文档流中,父元素的高度默认是被子元素撑开的,也就是子...

  • 高度塌陷 3月 前端 05Day

    高度塌陷 块的格式化环境 BFC BFC (隐含的属性) 1.父元素的垂直外边距不会和子元素重叠; 2.开启BF...

  • 《让未来现在就来》打卡05Day

    读的什么书:《让未来现在就来》 阅读有效时间:一个小时 阅读中遇到的困难:整本书读完,感觉效果不大。 阅读有什么收...

  • 香纱05day裂变增长实验室#挑战计划#

    第五天笔记,这个部分必须要经过实际的操作才会有所收益。六六的整个课件中非常的详细,无论是过程还是整个的话术部分,我...

网友评论

      本文标题:05day

      本文链接:https://www.haomeiwen.com/subject/prwizftx.html