您的位置:首页 > 编程语言 > ASP

ASP.NETdiv布局

2015-07-14 19:32 633 查看
最近刚上手asp.net,对其页面布局感到很困惑,刚学了css+div布局,于是写这篇文章,供大家一起互相学习。经常我们设计网页的时候需要看到这样的界面:



这就涉及到css+div布局了,接下来我们一步一步写代码,上面至少包含5个div,有一个是用来清除浮动的div,分别为:div_head,div_left,div_right,div_clr,div_foot.要实现上述布局,需要借助css来控制。接下来我贴上整个aspx页面html代码:

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title></title>


<style type="text/css">

#div_head,#div_foot{



border:1px solid yellow;

height:40px;



}

#div_left{


float:left;

boder:1px solid red;

width:288px;

height:200px;





}

#div_right{

float:right;

border:1px solid blue;

width:448px;

height:200px;

}

.clear{

clear:both;

}

</style>

</head>

<body>

    <form id="form1" runat="server">

    <div style="width:750px;">

    <div id="div_head" style=""></div>

       

            <div id="div_left">LEFT</div>

            <div id="div_right">RIGHT</div>

            <div class="clear" id="div_clr"></div>

       

        <div id="div_foot"></div>

    </div>

    </form>

</body>

</html>


这样就实现了上述布局,其他布局和其类似。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css clr