用div和css样式控制页面布局

王朝学院·作者佚名  2016-08-28
窄屏简体版  字體: 小  |  中  |  大  |  超大  

1<!DOCTYPE html>2<htmlxmlns="http://www.w3.org/1999/xhtml">3<head>4<metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/>5<title>网页布局练习</title>67<linkhref="../EX_asp.net/CSS

/div.css"rel="stylesheet"/>8</head>9<body>10<h1align="center">利用div和css对页面的布局进行调整</h1><hr/>11<divclass="d1">12<h3>窗口1</h3>13</div>14<divclass="d2"><h3>窗口2</h3></div>15<divclass="d3"><h3>窗口3</h3></div>16</body>17</html>

css代码:

1bod{2margin:100%;3padding:100%;45}6.d1{7width:200px;8height:600px;9background-color:red;10margin-left:20px;11margin-top:20px;12position:absolute;13}14.d2{15width:800px;16height:150px;17background-color:greenyellow;18position:absolute;19left:235px;20margin-top:20px;2122}23.d3{24width:800px;25height:420px;26position:absolute;27left:235px;28background-color:#19a1f8;29margin-top:200px;3031}

[flash=500,400]http://s1.knowsky.com/20160211/df0slugrcmr47.png[/flash]

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航