我的等高布局实现不了

来源:5-1 CSS margin负值定位

幸福来敲门4

2018-07-05 21:04

<style>

.box{overflow: hidden;resize: vertical;width: 1000px;}

.orange,.green{margin-bottom: -600px;padding-bottom: 600px;line-height: 50px;width:50%;}

.orange{background: orange;float: left;}

.green{background: green;float: left;}

</style>

<div class="box">

<nav class="orange">

<h3>导航1</h3>

</nav>

<section class="green">

模块1

</section>

<section class="green">

模块1

</section>

<section class="green">

模块1

</section>

</div>


写回答 关注

1回答

  • qq_行者_90
    2018-07-11 12:31:40

    <style>


    .box{overflow: hidden;resize: vertical;width: 1000px;}


    .orange,.green{margin-bottom: -600px;padding-bottom: 600px;line-height: 50px;width:50%;}


    .orange{background: orange;float: left;}


    .green{background: green;float: left;}

    </style>

    </head>

    <body>

    <div class="box">


    <nav class="orange">


    <h3>导航1</h3>


    </nav>


    <section class="green">


    模块1


    </section>


    <section class="green">


    模块1


    </section>


    <section class="green">

    </div>


CSS深入理解之margin

本CSS教程带你深入讲解CSS的margin属性,解决你多年困惑

55936 学习 · 68 问题

查看课程

相似问题