css3 子DIV需要自动智能定位,怎么做到底端对齐?

html-css021

css3 子DIV需要自动智能定位,怎么做到底端对齐?,第1张

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1"/>

<title>无标题文档</title>

<style type="text/css">

#main{

height:100%

overflow:hidden

}

.parent{

/*父容器是浮动导航,position必须使用fixed*/

position:fixed

top:0px

background-color:#333

width:100%

height:auto

min-height:150px

min-width:240px

}

.child1{

background-color:#069

height:150px

min-width:240px

float:left

}

.child2{

background-color:#F00

min-width:240px

height:80px

float:right

margin-top:70px

}

@media screen and (max-width:480px){

.child2{ margin-top:0float:left}

}

</style>

</head>

<body>

    <div class="parent">

        <div class="child1"></div>

            <div class="child2"></div>

            <div style="clear:both"></div>

        </div>

    </body>

</html>

var AdDivW = 100 //宽度

var AdDivH = 150 //高度

function scall(){

document.write ('<div id="Javascript.LeftDiv" style="position: absoluteborder: 1px solid #336699background-color:#EEEEE2z-index:1000width:'+AdDivW+'pxheight:'+AdDivH+'pxtop:-1000pxword-break:break-alldisplay:none">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>')

var Toppx = window.screen.height-AdDivH

document.getElementById("Javascript.LeftDiv").style.top=document.body.scrollTop+Toppx

}

window.onscroll=scall

window.onresize=scall

window.onload=scall