美文网首页
css之等高布局

css之等高布局

作者: Q_Mia | 来源:发表于2016-10-26 23:04 被阅读41次

1. 在父元素中不设置高度,使用overflow:hidden;

2. 使用很大的正padding-bottom,和相等的负的margin-bottom来实现

参考链接:http://www.51xuediannao.com/html+css/htmlcssjq/683.html

<div class="parent">

    <div class="left"></div>

   <div class="right"></div>

</div>

css:

.parent{

width:1000px;

overflow:hidden;

}

.left{

width:45%

float:left

padding-bottom:2000px;

margin-bottom:-2000px;

}

.right{

width:55%

float:right

padding-bottom:2000px;

margin-bottom:-2000px;

}

相关文章

  • css之等高布局

    1. 在父元素中不设置高度,使用overflow:hidden; 2. 使用很大的正padding-bottom,...

  • css等高布局

    首先页面template如下: 1.tabletable元素中的table-cell元素默认就是等高的 2.fle...

  • css等高布局

    一、CSS等高布局的7种方式https://www.cnblogs.com/xiaohuochai/p/54571...

  • 几种常见css布局

    单列布局 第一种 给定宽度,margin:auto即可实现 html css 第二种 html css 等高布局 ...

  • css实现等高布局

    等高布局是指在同一个父容器里,子元素的高度相等的布局方式,等高布局的实现有伪等高和真等高,伪等高只是在视觉上给人感...

  • 等分布局

    提供一种flex实现html代码如下 CSS代码 等高布局用table flex

  • CSS奇技淫巧之负边距的应用

    最近在学习flex布局,在赞叹其便捷性的同时,回想起之前使用css2的时候实现等高或者等宽布局的麻烦。同时也看到[...

  • 等高布局

  • 等高布局

    1、 使用数值非常大正padding-bottom与负margin-bottom 首先,两列都是左浮动,且都设置了...

  • 等高布局

    一、padding&margin的叠加 原理:,使用足够高的padding-bottom 来显示高度的落差部分,设...

网友评论

      本文标题:css之等高布局

      本文链接:https://www.haomeiwen.com/subject/xzjjuttx.html