flex 实例Demo
2024-08-26 18:30:34
Flex 页面布局 很方便 快捷 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>flex-1</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
body,html{
height: 100%
}
.col{
height: 100%;
background: #e3e3e3;
display: flex;
/* 正好与横向的属性设置相反 */
flex-direction:column;/* 将方向设置为垂直*/
justify-content: space-between;/* 两端对齐*/
align-items: center;/* 水平居中 */
} .head{
width: 200px;
height: 60px;
line-height: 60px;
text-align: center;
background: #fff;
} .content{
width: 300px;
height: 400px;
background: green;
} .row-between{
width: 90%;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
} .logo{
width: 50px;
height: 30px;
line-height: 30px;
background: pink;
text-align: center;
color:#fff;
} button{
width: 100px;
height: 30px;
border:1px solid pink;
border-radius: 8px;
background: #fff;
} </style>
</head>
<body> <div class="col"> <div class="head"> 我是个放头像的地方 </div> <div class="content">sdfasfasdfasdfasdfasdfasdfsaddfasdfasdfasdfasdf dfasdfasdfsaddfasdfasdfasdf</div> <div class="row-between"> <button>按钮一</button> <div class="logo"> logo </div> <button>按钮二</button> </div> </div> </body>
</html>
flex-1
我是个放头像的地方
sdfasfasdfasdfasdfasdfasdfsaddfasdfasdfasdfasdf dfasdfasdfsaddfasdfasdfasdf
按钮一
logo
按钮二
最新文章
- Linux上搭建Hadoop2.6.3集群以及WIN7通过Eclipse开发MapReduce的demo
- Xamarin笔记
- Web项目中删错文件怎么办
- date
- WPF TextBlock 绑定 换行
- jQuery实现隔行变色
- ffmpeg/ffplay vc6 源码剖析
- 【Mysql】安装 mysql-5.7.5 指南
- CSS code snip enjoy.
- vsphere client cd/dvd 驱动器1 正在连接
- 调整系统的inode数量
- java_web学习(十一) 层的概念与应用
- php+xdebug+dbgp远程调试(多人)
- 在线制作微信跳转浏览器下载app/打开指定页面源码
- HttpClient与浏览器调用服务接口差异
- Mac生成rsa证书
- 2018.10.27 loj#6035. 「雅礼集训 2017 Day4」洗衣服(贪心+堆)
- 使用JDBC一次执行多条语句(以MySQL为例)
- Jenkins CI CD
- C语言编程流程
热门文章
- document.ready与window.load区别
- selenium2 断言失败自动截图 (四)
- 581. Shortest Unsorted Continuous Subarray连续数组中的递增异常情况
- 如何从Win7上卸载Sql 2008 R2 Express,再重装
- sql server 错误总结
- hdu1269 Tarjan强连通分量 模板(转)
- initWithFrame 和 initWithCoder 区别?
- 编写高质量代码改善C#程序的157个建议——建议6: 区别readonly和const的使用方法
- Go语言最佳实践——通道和并发
- sqlserver跨服务器查询