flex-direction 排列方向
发布时间:2023-03-22 10:40:53 所属栏目:教程 来源:
导读: 在我们使用网易的Soul软件的时候,如果还不知道如何正确的设置我们捏脸软件的头像,那就通过下面的步骤,一起来学习一下吧。
Soul设置捏脸头像教程
1、点击【设置】按钮。
打开软件的自己
Soul设置捏脸头像教程
1、点击【设置】按钮。
打开软件的自己
在我们使用网易的Soul软件的时候,如果还不知道如何正确的设置我们捏脸软件的头像,那就通过下面的步骤,一起来学习一下吧。 Soul设置捏脸头像教程 1、点击【设置】按钮。 打开软件的自己页面,点击【设置】按钮。 2、点击【账户安全】按钮。 在设置页面,点击【账户安全】按钮。 3、点击【捏脸头像】按钮。 打开账户与安全页面,点击【捏脸头像】按钮。 4、点击选择捏脸头像效果,然后点击【完成】flex-direction 排列方向 弹性和模型中内部的子元素的排列方向可以通过这个属性修改,那么我们就一起看下它的使用吧。 1. 官方定义 flex-direction 属性规定项目的排列方向。 2. 解释 flex-direction 用来调整主轴的方向,我们知道主轴默认是水平方向且从左到右,而我们可以通过这个属性设置主轴的方向,即项目是水平方向从左到右还是垂直方向从上到下或者从下到上排列。 3. 语法 div{ flex-direction: row|row-reverse|column|column-reverse|initial|inherit; } <div class="demo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> .demo{ display:flex; // 让容器变成弹性盒 flex-direction:row-reverse; 改变项目的排列方向 } 4. 兼容性 IE Edge Firefox Chrome Safari Opera ios android 10+ 12+ 28+ 4+ 6.1+ 12.1+ 7+ 4.4 5. 实例 让子元素从上到下垂直方向排列 .demo{ display:flex; flex-direction:column; text-align: center; line-height: px; } .item{ background:#ccc; height:px; border-bottom:px solid #fff; } 从上到下排列效果图 <!DOCTYPE html> <html lang="en"> <head> <Meta charset="UTF-8"> <Meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .demo{ display:flex; flex-direction:column; text-align: center; line-height: px; } .item{ background:#ccc; height:px; border-bottom:px solid #fff; } </style> </head> <body> <div class="demo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> </body> </html> 让子元素从下到上反向排列 .demo{ display:flex; flex-direction:column-reverse; text-align: center; line-height: px; } .item{ background:#ccc; height:px; border-bottom:px solid #fff; } 从上到下反向排列效果图 <!DOCTYPE html> <html lang="en"> <head> <Meta charset="UTF-8"> <Meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .demo{ display:flex; flex-direction:column-reverse; text-align: center; line-height: px; } .item{ background:#ccc; height:px; border-bottom:px solid #fff; } </style> </head> <body> <div class="demo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> </body> </html> 让子元素从左到右排列 .demo{ display:flex; flex-direction:row; } .item{ background:#ccc; height:px; width: px; border-right:px solid #fff; } 从左到右排列效果图 <!DOCTYPE html> <html lang="en"> <head> <Meta charset="UTF-8"> <Meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .demo{ display:flex; flex-direction:row; text-align: center; line-height: px; } .item{ background:#ccc; height:px; width: px; border-right:px solid #fff; } </style> </head> <body> <div class="demo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> </body> </html> 让子元素从左到右反向排列 .demo{ display:flex; flex-direction:row-reverse; } .item{ background:#ccc; height:px; width: px; border-right:px solid #fff; } 效果图 编程之家 从左到右反向排列效果图 <!DOCTYPE html> <html lang="en"> <head> <Meta charset="UTF-8"> <Meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .demo{ display:flex; flex-direction:row-reverse; text-align: center; line-height: px; } .item{ background:#ccc; height:px; width: px; border-right:px solid #fff; } </style> </head> <body> <div class="demo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> </body> </html> 6. 经验分享 通过 flex 可以做一个上下固定,中间自适应的布局,它常常用于登录页那类的布局设置。 <div class="demo"> <div class="head">头部</div> <div class="content">内容</div> <div class="foot">尾部</div> </div> html,body{ padding:; margin:; height: ; color:#fff; } .demo{ height: ; display: flex; flex-direction: column; } .head,.foot{ flex: px; background: #000; } .content{ flex: ; background: red; } 案例: <!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>demo</title> <style> html,body{ padding:; margin:; height: ; color:#fff; } .demo{ height: ; display: flex; flex-direction: column; } .head,.foot{ flex: px; background: #000; } .content{ flex: ; background: red; } </style> </head> <body> <div class="demo"> <div class="head">头部</div> <div class="content">内容</div> <div class="foot">尾部</div> </div> </body> </html> 说明:这个布局就是两端固定,中间自适应的典型写法,而如果设置 flex-direction:row就变成了左右固定,中间自适应的横向布局。而他们正是组成页面的基础。 (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐