Skip to content
静心静心
HOME
DoubtfulCases
github icon
  • CSS

    • 标签
      • a标签
        • Label 标签
          • background
            • background属性
              • border和outline
                • borderAndoutline
                  • css - padding
                    • css 单位
                      • css 所有的居中(仅限参考)
                        • CSS 之 重构 回流
                          • Css选择器 权重
                            • css选择器
                              • CSS之阴影
                                • css之float
                                  • 1、简介(作用的对象和参数)
                                    • 2、float的用法
                                      • 3、float样式应用
                                      • css重点
                                        • grid布局
                                          • HTML基础标签+表单
                                            • table布局

                                            css 之float样式

                                            author iconYYtimer icon小于 1 分钟

                                            此页内容
                                            • 1、简介(作用的对象和参数)
                                            • 2、float的用法
                                            • 3、float样式应用

                                            # css 之float样式

                                            # 1、简介(作用的对象和参数)

                                            float:html的标签

                                            ​ div span a em 等等

                                            # 2、float的用法

                                            <style>
                                                div{
                                                    width:60px;
                                                    height: 60px;
                                                    background-color: darkgray;
                                                    margin: 20px;
                                                    float:right
                                                }
                                            </style>
                                            <body>
                                                <div></div>
                                                <div style="background-color: red; float: left;" ></div>
                                                <div></div>
                                                <div style="background-color: black;"></div>
                                            </body>
                                            
                                            1
                                            2
                                            3
                                            4
                                            5
                                            6
                                            7
                                            8
                                            9
                                            10
                                            11
                                            12
                                            13
                                            14
                                            15

                                            # 3、float样式应用

                                            <style>
                                            
                                                .top{
                                                    width:1129px;
                                                    height: 50px;
                                                    background-color: black;
                                                    color: white;
                                                    line-height: 50px;
                                                }
                                                .top span{
                                                    float:left;
                                                    margin-right: 20px;
                                                }
                                                .middle{
                                                    width:1129px;
                                                    height: 50px;
                                                    background-color: darkgray;
                                                }
                                                .content{
                                                    width: 1129px;
                                                    height: 800px;
                                                }
                                                .content .content-left{
                                                    width:70%;
                                                    height: 100%;
                                                    background-color: darkgreen;
                                                    float: left;
                                                    
                                                }
                                                .content .content-right{
                                                    width:30%;
                                                    height: 100%;
                                                    background-color: darkgoldenrod;
                                                    float: right;
                                                    
                                                }
                                            </style>
                                            <body>
                                                <div class="box">
                                                    <div class="top">
                                                        <span>首页</span>
                                                        <span>问答</span>
                                                        <span>树洞</span>
                                                        <span>动物园</span>
                                                       
                                                        <span style="float:right">鱼塘</span>
                                                        <span style="float:right">走边</span>
                                                    </div>
                                                    <div class="middle"></div>
                                                    <div class="content">
                                                        <div class="content-left"></div>
                                                        <div class="content-right"></div>   
                                                    </div>
                                                </div>
                                            </body>
                                            </html>
                                            
                                            1
                                            2
                                            3
                                            4
                                            5
                                            6
                                            7
                                            8
                                            9
                                            10
                                            11
                                            12
                                            13
                                            14
                                            15
                                            16
                                            17
                                            18
                                            19
                                            20
                                            21
                                            22
                                            23
                                            24
                                            25
                                            26
                                            27
                                            28
                                            29
                                            30
                                            31
                                            32
                                            33
                                            34
                                            35
                                            36
                                            37
                                            38
                                            39
                                            40
                                            41
                                            42
                                            43
                                            44
                                            45
                                            46
                                            47
                                            48
                                            49
                                            50
                                            51
                                            52
                                            53
                                            54
                                            55
                                            56
                                            edit icon编辑此页open in new window
                                            上一页
                                            CSS之阴影
                                            下一页
                                            css重点
                                            傻瓜都能写出计算机可以理解的代码。唯有能写出人类容易理解的代码的,才是优秀的程序员。
                                            Copyright © 2022 YY

                                            该应用可以安装在您的 PC 或移动设备上。这将使该 Web 应用程序外观和行为与其他应用程序相同。它将在出现在应用程序列表中,并可以固定到主屏幕,开始菜单或任务栏。此 Web 应用程序还将能够与其他应用程序和您的操作系统安全地进行交互。

                                            详情