zoukankan      html  css  js  c++  java
  • 刚看到一个前端面试题, 左边固定,右边自适应, 就根据自己想的自己写了下试试

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style>
    *{margin:0;padding:0;}
    .main{
        margin:0 auto;
        width:500px;    
        height:500px;
        background-color:orange;
    }
    .left{
        float:left;
        width:100px;
        height:200px;
        background-color:red;
    }
    .right{
        margin-left:100px;
        height:200px;
        background-color:blue;    
    }
    .test{
        float:left;
        background-color:white;    
    }
    </style>
    </head>
    
    <body>
    
    <div class="main">
        <div class="left">sdf</div>
        <div class="right">asdfasdf
            <div class="test">sadfsf</div>
        </div>
    </div>
    
    
    </body>
    </html>


    当然, 还有几种其他的办法, 自己能懂就好

  • 相关阅读:
    【设计模式
    【设计模式
    【设计模式
    【设计模式
    【设计模式
    【设计模式
    实干猪
    Mysql 千万级快速查询|分页方案
    如何成为一名优秀的CTO(首席技术官)
    成为优秀程序员的10个有效方法
  • 原文地址:https://www.cnblogs.com/freespider/p/3508749.html
Copyright © 2011-2022 走看看