HTML5使用伸缩布局实现网页的自适应

本文介绍了一个使用Flex布局的网页设计实例,详细展示了如何通过CSS的Flexbox特性来实现响应式设计,包括header、main和footer的布局技巧。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>flex弹性布局</title>
<style>
*{
padding: 0;
margin: 0;
}
header{
width: 100%;
display: flex;
}
header > a{
flex: 1;
}
header > a >img{
width: 100%;
}

main{
width: 100%;
padding: 0 10px;
box-sizing: border-box;
}
main > .item{
width: 100%;
height: 100px;
background-color: #57c3ae;
border-radius: 10px;
margin-top: 10px;
display: flex;
}
main > .item:nth-last-of-type(2){
background-color: #3c7267;
}
main > .item:nth-last-of-type(3){
background-color: #332f38;
}
main > .item:nth-last-of-type(4){
background-color: #723c4c;
}
main > .item >.left{
flex: 1;
}
main > .item >.right{
flex: 2;
flex-wrap: wrap;
display: flex;
}
main > .item >.right >a{
display: block;
width: 50%;
border-left: 1px solid #fff;
border-bottom: 1px solid #fff;
box-sizing: border-box;
line-height: 50px;
color: #fff;
text-decoration: none;
text-align: center;
}
main > .item >.right >a :nth-last-of-type(-n+2){
border-bottom: none;
}

main >.extra{
width:100%;
display: flex;
}
main >.extra >a {
flex:1;
}
main >.extra >a >img {
width:100%;
}

footer{
width:100%;
font-size: 13px;
}
footer > nav{
width:100%;
display: flex;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
footer > nav > a{
flex: 1;
line-height: 30px;
text-align: center;
color: #888;
text-decoration: none;
}
footer > .link{
text-align: center;
line-height: 25px;
}
footer > .copyRight{
text-align: center;
}
</style>
</head>
<body>
<div class="contai">
<header>
<a href="">
<img src="./images/test1.jpg" alt="">
</a>
 
</header>
<main>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="item">
<div class="left"></div>
<div class="right">
<a href="">海外酒店</a>
<a href="">团购</a>
<a href="">特惠酒店</a>
<a href="">客栈公寓</a>
</div>
</section>
<section class="extra">
<a href="">
<img src="./images/she.jpg" alt="">
</a>
<a href="">
<img src="./images/telangpu.jpg" alt="">
</a>
</section>
</main>
<footer>
<nav>
<a href="">电话预定</a>
<a href="">下载客户端</a>
<a href="">我的</a>
</nav>
<p class="link">
<a href="">网站地图</a>
<a href="">ENGLISH</a>
<a href="">电话地址</a>
</p>
<p class="copyRight">&copy;2015 携程旅行</p>
</footer>
</div>
</body>
</html>

转载于:https://www.cnblogs.com/liuhp/p/9704154.html

内容概要:本研究聚焦于绿电直连型电氢氨园区的优化运行,提出一种集成绿色电力直接供给、电解水制氢及氢气合成氨工艺的综合能源系统架构。通过建立包含风光发电、电解槽、氨合成反应器、储氢罐、电网交互及多类型负荷在内的系统模型,综合考虑绿电直供优先、能量梯级利用与多能互补原则,构建以系统综合运行成本最小化为目标的优化调度模型。研究采用Matlab与Python工具进行算法求解和仿真分析,利用实际气象与负荷数据完成案例验证,评估了不同运行策略下系统的经济性、可再生能源消纳能力与碳减排效益,为新型电氢氨一体化园区的规划与运行提供了理论依据和技术支撑。; 适合人群:具备一定电力系统、新能源或化工背景的研究生、科研人员及从事综合能源系统规划与优化工作的工程技术人员。; 使用场景及目标:①用于科研学习,理解电-氢-氨多能转换系统的建模与优化方法;②为工业园区的低碳化、智能化改造提供技术参考与决策支持;③作为开发类似综合能源管理系统的理论基础。; 阅读建议:此资源包含完整的模型代码、数据与论文,使用者应结合代码仔细研读论文中的模型构建部分,重点关注目标函数与约束条件的设计逻辑,并尝试修改参数进行仿真,以深入掌握优化算法在实际系统中的应用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值