美文网首页
前端06day

前端06day

作者: Tellme丶 | 来源:发表于2018-11-22 08:43 被阅读0次

浮动

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

项目布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>蔚蓝网</title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        .a{
            width: 1748px;
            height: 4016px;
            background-color: skyblue;
        }
        .b{
            width: 1748px;
            height: 170px;
            background-color: yellow;
            margin: 0 auto;
        }
        .ab{
            width: 997px;
            height: 44px;
            background-color: gold;
            margin: 0 auto;
        }
        .ac{
            width: 981px;
            height: 90px;
            background-color: brown;
            margin: 0 auto;
            margin-top: 1px;
        }
        .ad{
            width: 981px;
            height: 34px;
            background-color: green;
            margin: 0 auto;
            margin-top: 1px;
        }
        .c{
            width: 248px;
            height: 819px;
            background-color: red;
            float: left;
            margin-left:376px;
            margin-bottom: 24px;
        }
        .d{
            width: 750px;
            height: 819px;
            background-color: yellow;
            float: left;
            margin-left: 5px;
            margin-bottom: 24px;
        }
        .e{
            width:998px;
            height:526px;
            background-color: gold;
            float: left;
            margin-left: 376px;
            margin-bottom: 30px;
        }
        .f{
            width: 998px;
            height: 520px;
            background-color: yellow;
            float: left;
            margin-left: 376px;
            margin-bottom: 30px;
        }
        .g{
            width: 998px;
            height: 433px;
            background-color: gold;
            float: left;
            margin-left: 376px;
            margin-bottom: 30px;
        }
        .h{
            width: 998px;
            height: 494px;
            background-color: yellow;
            float: left;
            margin-left: 376px;
            margin-bottom: 30px;
        }
        .i{
            width: 998px;
            height: 525px;
            background-color: gold;
            float: left;
            margin-left: 376px;
            margin-bottom: 30px;
        }
        .j{
            width: 998px;
            height: 171px;
            background-color: yellow;
            float: left;
            margin-left: 376px;
        }
        .k{
            width: 1748px;
            height: 230px;
            background-color: gold;
            float: left;
        }

    </style>
</head>
<body>
    <div class="a">
        <div class="b">
            <div class="ab"></div>
            <div class="ac"></div>
            <div class="ad"></div>
        </div>
        <div class="c">
            <div class="cc"></div>
        </div>
        <div class="d"></div>
        <div class="e"></div>
        <div class="f"></div>
        <div class="g"></div>
        <div class="h"></div>
        <div class="i"></div>
        <div class="j"></div>
        <div class="k">
            <img src="img/canvas.png">
        </div>
    </div>

</body>
</html>

相关文章

  • 前端06day

    opacity属性在IE8及以下的浏览器中不支持IE8及以下的浏览器需要使用如下属性代替alpha(opacity...

  • 前端06day

    浮动 display:inlineblock;块元素脱离文档流:,在父元素中浮动起来。宽度占父元素100% 块独占...

  • 06day

    表格边框 如需在 CSS 中设置表格边框,请使用 border 属性。下面的例子为 table、th 以及 td ...

  • 背景图片 3月 前端 06Day

    z-inlin 可以提升定位元素所在的层级;对于没有开启的时候不能用z-inline; z-index可以指定一个...

  • 网页06day

    background-color:background-color属性用来为元素设置背 景颜色。需要指定一个颜色值...

  • 前段------06day

    Document *{margin: 0;padding: 0;}ul{l...

  • 爬虫06day

    什么是xpath? xpath (lxml Path language)是一门在xml文档中查找信息的语言,可以遍...

  • 导航条------06day

  • 前端文章系列

    【前端】从0.1开始,创建第一个项目 【前端】初识HTML 【前端】HTML标签 【前端】HTML属性 【前端】C...

  • Web前端小白入门指迷

    大前端之旅 大前端有很多种,Shell 前端,客户端前端,App 前端,Web 前端和可能接下来很会火起来的 VR...

网友评论

      本文标题:前端06day

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