zoukankan      html  css  js  c++  java
  • css左右布局,左侧固定,右侧自适应

    实现布局的几种方法,见代码:

    <!DOCTYPE html>
    <html lang="cn">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
        .content{
            width: 100%;
            height: 50px;
            border: solid 1px;
            margin-top: 10px;
    
        }
        .content div:first-child{
            background: red;
            height: 50px;
            width:50px;
        }
        .content div:last-child{
            background: green;
            height: 50px;
        }
        </style>
    </head>
    <body>
        <!--浮动-->
        <div class="content" >
            <div style="float: left;"></div>
            <div style="margin-left: 50px;"></div>
        </div>
        <!--绝对定位-->
        <div class="content" >
            <div style="position: absolute"></div>
            <div style="overflow:hidden;"></div>
        </div>
        <!--flex-->
        <div class="content" style="display:flex;">
            <div ></div>
            <div style="flex-grow: 1"></div>
        </div>
        <!--表格-->
        <table class="content" style="border-collapse: collapse;">
            <tr>
                <td style="50px;background:red;"></td>
                <td style="background:green;"></td>
            </tr>
        </div>
    </body>
    </html>
  • 相关阅读:
    mysql修改加密方式
    信息安全学习路线
    DNS域传送漏洞
    CSRF漏洞
    反序列化漏洞
    计算机通讯基础
    gorm gen使用
    golang makefile使用
    linux命令行录制
    go代码自动生成注释
  • 原文地址:https://www.cnblogs.com/fanlu/p/10785020.html
Copyright © 2011-2022 走看看