当前位置: 首页 > news >正文

加强机关门户网站建设游戏推广可以做吗

加强机关门户网站建设,游戏推广可以做吗,如何做商业推广网站,做网站 每月赚 钱概念 弹性盒子是一种用于按行或者按列布局的一维布局方法,元素可以膨胀以填充额外的空间,缩小以适应更小的空间 以下属性是给父元素添加的 1.flex-direction --改变轴的方向 row 默认值 默认沿着x轴排版(横向从左到右排列(左对齐&#xff…

概念

弹性盒子是一种用于按行或者按列布局的一维布局方法,元素可以膨胀以填充额外的空间,缩小以适应更小的空间

 以下属性是给父元素添加的

1.flex-direction --改变轴的方向

  • row 默认值 默认沿着x轴排版(横向从左到右排列(左对齐),默认的排列方式。)
  • row-reverse --沿着x轴右边排版(反转横向排列(右对齐),从后往前排,最后一项排在最前面。)
  • column --沿着xy轴从上到下排版(纵向排列。)
  • column-reverse --沿着xy轴从下到上排版(反转纵向排列,从后往前排,最后一项排在最上面。)
<style>.main{width: 500px;height: 500px;background: skyblue;/* 变成弹性盒子,让元素沿着主轴排列(水平排列)1.如果盒子变成了弹性盒子,浮动属性会失效 */display: flex;/* 默认值是row */flex-direction: row;/* 沿着x轴右边排版 */flex-direction: row-reverse;/* 沿着xy轴从上到下排版 */flex-direction: column;/* 沿着xy轴从下到上排版 */flex-direction: column-reverse;}.main div{width: 100px;height: 400px;background-color: red;font-size: 20px;}</style>
</head>
<body><div class="main"><div>1</div><div>2</div><div>3</div></div>
</body>

  总结:
    1、给父元素添加  display: flex;  子元素就具备了弹性盒的功能
    2、给父元素设置 flex-direction 可以更改子元素排版的主轴是x轴还是 y 轴 

2.flex-wrap 换行与缩写

注意:弹性盒子的宽度是自动变化的,如果不做设置,弹性盒子元素不会溢出,只有在足够多的情况下才溢出。

属性值:

  • nowrap 默认值 不换行(默认, 弹性容器为单行。该情况下弹性子项可能会溢出容器。)
  • wrap 换行加入的是两行,会把父元素氛围对等的两部分,子元素在每一个部分中都是顶端对齐。依次类推( 弹性容器为多行。该情况下弹性子项溢出的部分会被放置到新行,子项内部会发生断行)
  • wrap-reverse:反转折行(反转 wrap 排列。)
<style>.main{width: 500px;height: 500px;background: skyblue;display: flex;flex-wrap: nowrap;/* flex-wrap: wrap; *//* flex-wrap: wrap-reverse; */}.main div{width: 100px;height: 400px;background-color: red;font-size: 20px;}</style>
</head>
<body><div class="main"><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div></div>

 

 1、如果子元素有高度 子元素正常显示高度 如果子元素没有高度,
那么,子元素的高度就是父元素的高度(平均分配的时候,是父元素中每一份的高度)
2、如果子元素没有宽度,子元素的宽度就是内容撑开的宽度

 2.1改变轴和换行结合起来使用

.main {width: 500px;height: 500px;background: skyblue;display: flex;/* 主轴和换行结合使用 */flex-direction: column-reverse;flex-wrap: wrap;// 注意:并不适合列的自适应
}

 简写

/* 简写 */
flex-flow: column-reverse wrap;

 3.justify-content -主轴的对齐方式 --针对某一个元素

内容对齐(justify-content)属性应用在弹性容器上,把弹性项沿着弹性容器的主轴线(main axis)对齐。

  • flex-start 默认 在主轴的默认对齐方式
  • flex-end 在主轴的末尾开始对齐
  • center 在主轴的中间对齐
  • space-round 在主轴上平均分配空间
  • space-between 在主轴上的两端拥有两个元素分别对齐,剩余元素平均分配剩余空间
  • space-evenly 所有的元素平均分配剩余空间

<style>.main {width: 500px;height: 500px;background: skyblue;display: flex;/* - flex-start 默认 在主轴的默认对齐方式  */justify-content: flex-start;/* - flex-end 在主轴的末尾开始对齐  *//* justify-content: flex-end; *//* - center 在主轴的中间对齐  *//* justify-content: center; *//* - space-round 在主轴上平均分配空间  *//* justify-content: space-around; *//* - space-between 在主轴上的两端有两个元素分别对齐,剩余元素平均分配剩余空间  *//* justify-content: space-between; *//* - space-evenly 所有的元素平均分配剩余空间  *//* justify-content: space-evenly; */}.main div{width: 100px;height: 400px;background-color: red;font-size: 20px;}</style>
</head><body><div class="main"><div>1</div><div>2</div><div>3</div><div>4</div></div>
</body>

 

4.交叉轴对齐 --align-content --针对的是整体

align-content 属性用于修改 flex-wrap 属性的行为。类似于 align-items, 但它不是设置弹性子元素的对齐,而是设置各个行的对齐。

  • stretch 默认值(默认。各行将会伸展以占用剩余的空间。)
  • flex-start 在主轴默认对齐方式(各行向弹性盒容器的起始位置堆叠。)
  • flex-end在主轴的末尾开始对齐(各行向弹性盒容器的结束位置堆叠。)
  • center 在主轴的中间对齐(各行向弹性盒容器的中间位置堆叠。)
  • space-round 在主轴上平均分配空间(各行在弹性盒容器中平均分布。)
  • space-between 在主轴上的两端有两个元素分别对齐,剩余元素平均分配剩余空间(各行在弹性盒容器中平均分布,两端保留子元素与子元素之间间距大小的一半。)
  • space-evenly 所有元素平均分配剩余空间

 <style>.main {width: 500px;height: 500px;background: skyblue;display: flex;flex-wrap: wrap;/* 只有一行不换行的情况下,align-content是不生效的  其实就是一个多行的排列的方式 *//* - stretch  默认值  */align-content: stretch;/* - flex-start  在主轴默认对齐方式 *//* align-content: flex-start; *//* - flex-end 在主轴的末尾开始对齐 *//* align-content: flex-end; *//* - center  在主轴的中间对齐 *//* align-content: center; *//* - space-round  在主轴上平均分配空间 *//* align-content: space-around; *//* - space-between 在主轴上的两端有两个元素分别对齐,剩余元素平均分配剩余空间 *//* align-content: space-between; *//* - space-evenly  所有的元素平均分配剩余空间 *//* align-content: space-evenly; */}.main div{width: 100px;height: 400px;background-color: red;font-size: 20px;}</style>
</head><body><div class="main"><div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div></div>
</body>

 

 5.algin-items --针对行

align-items 设置或检索弹性盒子元素在侧轴(纵轴)方向上的对齐方式。

  • stretch 默认值
  • flex-start 在主轴默认对齐方式
  • flex-end 在主轴的末尾开始对齐
  • center 在主轴的中间对齐
  • baseline 基线对齐
.main {width: 500px;border: 1px solid #000;display: flex;/* 注意:不换行也是不生效的 *//* - stretch  默认值  *//* align-items: stretch; *//* - flex-start  在主轴默认对齐方式 *//* align-items: flex-start; *//* - flex-end 在主轴的末尾开始对齐 *//* align-items: flex-end; *//* - center  在主轴的中间对齐 *//* align-items: center; *//* - baseline  基线对齐 */align-items: baseline;
}

6、内联(行元素)与块的上下左右居中布局

内联元素居中

  1. flex 布局(父级 justify-content: center 和 align-items: center 即可)
.box{width: 300px;height: 300px;background-color: skyblue;display: flex;align-items: center;
}
.box{width: 300px;height: 300px;background-color: skyblue;display: flex;flex-wrap: wrap;align-content: center;
}

2.行高line-height,设置与盒子高度一样的行高

.box{width: 300px;height: 300px;background-color: skyblue;line-height: 300px;
}

3.vertical-align 用来指定行内元素(inline)或表格单元格(table-cell)元素的垂直对齐方式。

.box {width: 300px;height: 300px;background-color: skyblue;display: table-cell;  vertical-align: middle;
}

块元素居中

4.

.box{width: 300px;height: 200px;background-color: skyblue;display: flex;justify-content: center;align-items: center;
}
.box div{width: 100px;height: 100px;background-color: blue;
} 

5.

.box {width: 300px;height: 200px;background-color: skyblue;display: flex;position: relative;
}.box div {width: 100px;height: 100px;background-color: blue;margin: auto;
}

6.

.box {width: 300px;height: 200px;background-color: skyblue;position: relative;
}.box div {width: 100px;height: 100px;background-color: blue;position: absolute;top: 0;left: 0;right: 0;bottom: 0; margin: auto;
}

7. 定位+外边距  
定位+动画中的位移 

<style>
/* 第一种 文字水平剧中 */
/*  .box{width: 300px;height: 300px;background-color: skyblue;display: flex;align-items: center;
} *//* 第二种方式 */
/* .box{width: 300px;height: 300px;background-color: skyblue;display: flex;flex-wrap: wrap;align-content: center;
}
*/
/* 第三种 行高  -- 针对一行比较好用  多行不合适 */
/*  .box{width: 300px;height: 300px;background-color: skyblue;line-height: 300px;
}
*//* 第四种 display: table-cell; */
/*  .box {width: 300px;height: 300px;background-color: skyblue;display: table-cell;  vertical-align: middle;
} *//* 块元素剧中 */
/*  .box{width: 300px;height: 200px;background-color: skyblue;display: flex;justify-content: center;align-items: center;
}
.box div{width: 100px;height: 100px;background-color: blue;
} *//*  .box {width: 300px;height: 200px;background-color: skyblue;display: flex;position: relative;
}.box div {width: 100px;height: 100px;background-color: blue;margin: auto;
} */.box {width: 300px;height: 200px;background-color: skyblue;position: relative;
}.box div {width: 100px;height: 100px;background-color: blue;position: absolute;top: 0;left: 0;right: 0;bottom: 0; margin: auto;
}/* 定位+外边距  
定位+动画中的位移 */
</style>
</head><body>
<!--  <div class="box">
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试
测试文字测试文字测试</div> --><div class="box">
<div></div>
</div>
</body>

7、不定向居中布局

<style>
/* 弹性盒 */
/*    .box{width: 300px;height: 150px;background-color: skyblue;display: flex;justify-content: center;align-items: flex-end;
}
.box div{width: 30px;height: 30px;background-color: red;border-radius: 50%;margin: 5px;
} *//* 普通方式 */
.box {width: 300px;height: 150px;background-color: skyblue;position: relative;
}
.box section{text-align: center;width: 100%;position: absolute;bottom: 0;
}.box div {width: 30px;height: 30px;background-color: red;border-radius: 50%;display: inline-block;margin: 5px;
}
</style>
</head><body>
<!--  <div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
</div> --><div class="box">
<section><div>1</div><div>2</div><div>3</div><div>1</div><div>2</div><div>3</div>
</section>
</div>
</body>

8.均分列布局

比如微信聊天窗口列表的菜单布局

<style>
/* 弹性盒 */
/*  .main{height: 200px;background-color: skyblue;display: flex;justify-content: space-between;align-items: flex-end;padding: 0 20px;
}
.main div{width: 30px;height: 30px;background-color: red;border-radius: 50%;
} *//* 普通方式 -- 微调*/
.main {width: 500px;height: 200px;background-color: skyblue;overflow: hidden;padding: 0 20px;box-sizing: border-box;
}.main section {width: 600px;
}.main div {width: 30px;height: 30px;background-color: red;border-radius: 50%;float: left;margin-right: 70px;
}
</style>
</head><body>
<!--  <div class="main">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div> --><div class="main">
<section><div></div><div></div><div></div><div></div><div></div><div></div>
</section>
</div>
</body>

 

9.子项分组布局

<style>
/*  .main{height: 200px;background-color: skyblue;display: flex;justify-content: space-between;align-items: center;
}.main div:nth-of-type(2){display: flex;margin-left: 10px;
}
.main .box{width: 50px;height: 100px;background-color: blue;
} */.main {height: 200px;background-color: skyblue;display: flex;align-items: center;
}
.main div{width: 50px;height: 50px;background-color: red;margin-right: 10px;
}
.main div:nth-of-type(3){margin-right: auto;
}.main div:nth-of-type(6){margin-right: auto;
}</style>
</head><body>
<!-- <div class="main">
<div class="box">1</div>
<div><div class="box">2</div><div class="box">3</div>
</div>
</div> --><div class="main">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
</div>
</body>

 

http://www.bjxfkj.com.cn/article/100696.html

相关文章:

  • 3d效果图教程网站百度链接提交工具
  • 江苏建设工程招标网官方网站专业排名优化工具
  • 宽屏网站设计seo是什么职位
  • 那里有做像美团的网站的建立免费网站
  • 太原做网站的网络工作室大数据查询个人信息
  • 做班级的活动的网站软文世界
  • seo关键词优化技术江门seo网站推广
  • cms网站开发流程今日头条新闻军事
  • ui人机界面设计广州网站优化平台
  • 做视频网站服务器多少钱淄博seo网络公司
  • 武汉个人做网站泉州全网营销优化
  • 音乐网站开发 群新乡百度关键词优化外包
  • 赤峰北京网站建设免费推广网站平台
  • 一家专门做特卖的网站手机版seo的优化方向
  • 两学一做网站源码百度一下浏览器下载安装
  • 上海网站建设 知名觉东莞关键词排名seo
  • 网站开发项目需求方案百度网站推广怎么收费
  • 如何做一个企业的网站百度竞价怎么排名第一
  • wordpress 开启手机标题seo是什么意思
  • ajax数据库网页网站设计免费网站外链推广
  • 做网站建设的电话销售新冠不易感染三种人
  • 厦门建站系统建设游戏特效培训机构排名
  • 做自己的网站发表文章后怎么能让钱赚到手是不是点击率高就可以有收入?请高人指教!感激涕零!seo基础培训
  • 深圳分销网站设计费用互联网营销师报名费
  • 网页游戏网站排名前10名seo优化销售话术
  • 群晖 做网站seo实战教程
  • 潍坊网站设计公司seo外链收录
  • 高级网站设计北京seo优化wyhseo
  • 网站建设哪家做的好计算机培训机构排名
  • 怎么做网站促收录房地产最新消息