解决:并排的两个div底部对齐
我希望在页面上画2个栈,并列起来,并且其内容是动态的,高度、宽度都可变,但是要保持底部对齐,如图:

实现的代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Insert title here</title>
</head>
<style type="text/css">
#t_1{
position: relative;
}
#t_2{
display: inline-block;
background-color: red;
bottom: 0;
}
#t_3{
display: inline-block;
background-color: red;
right: 0;
bottom: 0;
}
</style> <body>
<div id="t_1">
<div id="t_2">
<div>haha</div>
<div>haha</div>
<div>haha</div>
</div>
<div id="t_3">
<div>haha</div>
<div>haha</div>
<div>haha</div>
<div>haha</div>
<div>haha</div>
<div>haha</div>
</div>
</div>
</body>
</html>
效果:

解决:并排的两个div底部对齐的更多相关文章
- 并排的两个div之间会有空隙
两个并排的DIV会有如下图所示的空隙 是因为 代码中 两个DIV之前有个 ’回车‘ 这么写就OK了 可是为什么会有这种问题呢,是因为浏览器将 空格.回车.tab键等字符都当做一个空格处理,所以当你回车 ...
- 两个div并列居中显示——当display:inline-block;时,两个div无法对齐即一高一矮
解决办法: 给div添加样式vertical-align: top;
- DIV相对于父DIV底部对齐的实现方法
代码如下 <style type="text/css"> .box1 {border:1px #cccccc solid; width:500px; height:60 ...
- CSS布局之div交叉排布与底部对齐--flex实现
最近在用wordpress写页面时,设计师给出了一种网页排布图样,之前从未遇到过,其在电脑上(分辨率大于768px)的效果图如下: 而在手机(分辨率小于等于768px)上要求这样排列: 我想到了两种方 ...
- 两个div并排显示,当浏览器界面缩小时会出现换行
解决:规定两个子div的父div的宽 <div id="showDataDiv" style="width: 1000px"> <div st ...
- 一个div居于另一个div底部
一个div如何与另一个div底部对齐,方法有很多,比如使用绝对定位 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/ ...
- DIV+CSS布局问题:一个宽度不确定的DIV里面放三个水平对齐的DIV,左右两个DIV宽度固定为150px,中间那个DIV充满剩余的宽度
一个入门的DIV+CSS布局问题:一个宽度不确定的DIV里面放三个水平对齐的DIV,左右两个DIV宽度固定为150px,中间那个DIV充满剩余的宽度. 说明:代码非真实情况下使用,所以直接简单. 没耐 ...
- NO.14 两个div并排,左边为绝对宽度,右边为相对宽度
两个div并排,左边为绝对宽度,右边为相对宽度,这个问题,我也经常遇到,我一般的处理方法是将最大的容器padding-left固定宽度,左边的固定宽度的一块position:absolute,然后ri ...
- 让两个Div并排显示
一.使用display的inline属性 <div style="width:300px; height:auto; float:left; display:inline"& ...
随机推荐
- Python中的计数(词频)
1,对于list列表来说 a.用自定义函数来统计技术 def get_count(sequence): counts={} for x in sequence: if x in sequence: c ...
- Careercup - Google面试题 - 6332750214725632
2014-05-06 10:18 题目链接 原题: Given a ,) (,) (,), (,) should be returned. Some suggest to use Interval T ...
- 【Insertion Sorted List】cpp
题目: Sort a linked list using insertion sort. 代码: /** * Definition for singly-linked list. * struct L ...
- R 实例1
//转载:http://www.r-china.net/forum.php?mod=viewthread&tid=881&extra=page%3D1//用R抓取人民日报网数据 lib ...
- [geeksforgeeks] Lowest Common Ancestor in a Binary Search Tree.
http://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-search-tree/ Lowest Common Ancestor ...
- 从maya导入物体 Importing Objects From Maya
原地址:http://game.ceeger.com/Manual/HOWTO-ImportObjectMaya.html Unity natively imports Maya files. To ...
- mybatis中:returned more than one row, where no more than one was expected.异常
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorEx ...
- 收集几个Web前端UI框架
原文:http://www.isaced.com/post-200.html 关于Web前端UI库/框架,我觉得是非常方便的东西,对于我们这种业余的Web开发人员,有时候要写点前端代码的时候把UI框架 ...
- ZJU 1180 Self Numbers(暴力模拟判断,水题)
题目链接 同HDU 1128 , POJ 1316(这个范围小一点). 原本怕超时,以为有技巧或者规律,死命的想,后来发现这就是一道水体,模拟着全部判断一下就好了,10秒呢,完全不怕超时...唔,废话 ...
- POJ 2227 The Wedding Juicer (优先级队列+bfs+dfs)
思路描述来自:http://hi.baidu.com/perfectcai_/item/701f2efa460cedcb0dd1c820也可以参考黑书P89的积水. 题意:Farmer John有一个 ...