垂直将动态高度的DIV与另一个DIV内部对齐 [英] Vertical Align a DIV with dynamic height inside another DIV

查看:193
本文介绍了垂直将动态高度的DIV与另一个DIV内部对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在环顾四周,似乎找到了很多关于垂直对齐div的方法,但是没有围绕它的动态高度div。我有一些我需要的东西,从我找到的各种不同的模板构建而成。 。我只是不能让它做我想做的事可能我完全错了?..我认为这将是简单的,但已经转向南..我希望在这里somone可以明白我的意思,并很容易修复,因为我迷路了... ...尝试了很多不同的东西,但最终只能回到原点。



我在vdotmedia签出了vertical-center-content-with-css这正是我需要的div做但是我不能让它在模板中工作,我已经想出了..我希望它是跨浏览器和ie6会很好,但至少ie7 ..

感谢高级!

代码在这里有点长,所以请查看我之后的链接。 。
h ttp://www.mmageardirect.com.au/tmp/index.htm

解决方案

检查一下: http://blog.themeforest.net/tutorials/vertical-使用 vertical-align:middle 和一组div来设置中心与css /



display:table table-row , table-cell


I have been looking around and seem to find lots about aligning a div vertically however not with a dynamic height div surrounding it.. i have a moch up of what i require, built from all sorts of different templates i have found.. i just cant get it to do what I want maybey i am totally wrong?.. i thought it would be simple however has turned south.. i am hoping somone on here can understand what i mean and fix it easily as I am lost... tried so many different things however just end up back to square one..

I have checked out "vertically-center-content-with-css" at vdotmedia and this is exactly what i need the div to do however i can't get it working in the template i have come up with.. i do want it to be cross browser and ie6 would be nice but at least ie7..

Thanks in advanced!

The code was a bit long for here so see the link for what i am after.. http://www.mmageardirect.com.au/tmp/index.htm

解决方案

Not so easy but check this out: http://blog.themeforest.net/tutorials/vertical-centering-with-css/

Try using vertical-align: middle and a set of divs with display:table, table-row, table-cell.

这篇关于垂直将动态高度的DIV与另一个DIV内部对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆