网页设计练习

本文通过一个具体的实例展示了如何使用HTML和CSS实现固定头部、相对定位主体及多个浮动区块的网页布局。介绍了不同区块的尺寸设定、位置安排及其样式配置。

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>汉企网页</title>
<style>
*
{ margin:0px;
padding:0px;


}
.a{ width:100%; top:0px; left:0px;
height:150px;
background-color:#036;
position:fixed; z-index:2;
}
.b{ width:100%;
top:150px;
height:300px;
background-color:#CCC;
position: relative;
}
.d{ width:80%; top:200px; border:1px solid; left:10%;
height:700px;
position: relative;
}

.c{ width:250px; left:6%; top:30px;
height:250px;
background-color:#0F0; float: left; margin:5% ;
}
.e{ width:600px; height:60px; top:80px; right:200px; background-color:#FC0; position:absolute; }
.f{ width:110px; height:40px; background-color:#6FC; float:left; margin-top:10px; margin-left:30px;}

</style>

</head>

<body>


<div class="a" ><div class="e" ><div class="f" ></div><div class="f" ></div><div class="f" ></div><div class="f" ></div></div></div>
<div class="b" ></div>

<div class="d"><div class="c"></div><div class="c"></div><div class="c"></div><div class="c"></div><div class="c"></div><div class="c"></div></div>
</body>
</html>

转载于:https://www.cnblogs.com/lulichao/p/5770487.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值