我有两个非常窄(宽度:400像素)的div,如果浏览器窗口中有足够的垂直空间,则应垂直堆叠.如果浏览器高度太小并且有足够的空间,则“底部div”应浮动到顶部div的右侧.
从某种意义上说,我要求与“浮动:左”相反. float:如果浏览器窗口中有足够的水平空间,则left align divs水平,如果只有其他可用空间,则只有float divs低于其他.
谢谢你的任何建议!
ottom-floaty {
height:200px;
width: 400px;
margin: 15px; padding: 10px;
outline: 1px dashed #aaf;
}
/* HERE FOLLOWS THE MAGICAL MEDIA QUERY FOR TALL SCREENS */
@media all and (max-height: 500px) {
.bottom-floaty { float:left; }
}
ottom-floaty">
I'm a sometimes floaty div