双飞翼布局

7 篇文章 0 订阅

 双飞翼布局: 两边定宽,中间自适应(随着屏幕宽度的大小而改变),

如下图:

贴上代码:

<!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 charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <title>双飞翼布局</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        .sub,
        .main,
        .extra {
            float: left;
            min-height: 30px;
        }

        .sub {
            margin-left: -100%;
            width: 100px;
            background: red;
            position: relative;
        }

        .extra {
            margin-left: -120px;
            width: 120px;
            background: blue;
            position: relative;
        }

        .main {
            width: 100%;
        }

        .main-inner {
            margin-left: 105px;
            margin-right: 125px;
            min-height: 30px;
            background: green;
            word-break: break-all;
            position: relative;
        }

        .dd,
        .progress,
        .cc {
            margin: 0;
            position: absolute;
            top: 50%;
            left: 50%;
            -ms-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
        }

        .progress {

            height: 5px;
            background-color: fuchsia;
            width: 100%;
        }
    </style>
</head>

<body>

    <div class="main">
        <div class="main-inner">
            <div class="progress">
            </div>
        </div>
    </div>
    <div class="sub">
        <div class="dd">
            <span class="glyphicon glyphicon-fast-backward"></span>
            <span class="glyphicon glyphicon-play"></span>
            <span class="glyphicon glyphicon-fast-forward"></span>
        </div>
    </div>
    <div class="extra">
        <div class="cc">
            <select>
                <option value="">1</option>
                <option value="">2</option>
                <option value="">3</option>
            </select>
            <span class=" glyphicon glyphicon-retweet"></span>
        </div>
    </div>

</body>

</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值