<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.boss {
width: 400px;
height: 300px;
border: 1px solid red;
display: flex;
/* flex-flow: column-reverse wrap-reverse; */
}
.box1 {
width: 100px;
height: 100px;
background-color: pink;
/* order: -2; */
align-self: auto;
}
.box2 {
width: 100px;
height: 100px;
background-color: orange;
align-self: flex-end;
}
.box3 {
width: 100px;
height: 100px;
background-color: aqua;
/* order: -1; */
align-self: center;
}
.boxx1 {
width: 300px;
height: 300px;
border: 30px solid aqua;
/* border-top: 10px solid red;
border-left: 20px solid red;
border-bottom: 30px solid red;
border-right: 40px solid red; */
/* border-top-width: 10px;
border-left-width: 20px;
border-bottom-width: 30px;
border-right-width: 40px;
border-top-style: solid;
border-left-style: dashed;
border-bottom-style: dotted;
border-right-style: double; */
/* none:没有边框,即忽略所有边框的宽度(默认值)
·solid:边框为单实线
·dashed:边框为虚线
·dotted:边框为点线
·double:边框为双实线 */
/* border-top-color: red;
border-left-color: orange;
border-bottom-color: pink;
border-right-color: aqua; */
/* 圆角 */
/* border-radius: 10px 20px 30px; */
/* border-radius: 50%; */
/* 边框阴影 */
/* box-shadow: 水平 垂直 大小 颜色; */
/* 图形边框 */
border-image: url(../../2.png) 15 15 round;
}
</style>
</head>
<body>
<!-- flex-flow 属性是 flex-direction 和 flex-wrap 属性的复合属性。
flex-flow 属性用于设置或检索弹性盒模型对象的子元素排列方式。
flex-direction 属性规定灵活项目的方向。
flex-wrap 属性规定灵活项目是否拆行或拆列。
flex-flow:flex-direction flex-wrap;复合属性
flex-direction代表的值有:row|row-reverse|column|column-reverse
flex-wrap代表值有:nowrap|wrap|wrap-reverse
-->
<!-- order弹性子元素,排序,用整数值来定义排列顺序,数值小的排在最前面,
可以 为负值,属性设置弹性容器内弹性子元素属性 -->
<!-- align-self 属性用于设置弹性元素自身在侧轴(纵轴)方向上的对齐方式。注:给子元素设置
align-self: auto | flex-start | flex-end | center | baseline | stretch
- auto
如果'align-self'的值为'auto',则其计算值为元素的父元素的'align-items'值,如果其没有父元素,则计算值为'stretch'。
- flex-start
弹性盒子元素的侧轴(纵轴)起始位置的边界紧靠住该行的侧轴起始边界。
- flex-end
弹性盒子元素的侧轴(纵轴)起始位置的边界紧靠住该行的侧轴结束边界。
- center
弹性盒子元素在该行的侧轴(纵轴)上居中放置。(如果该行的尺寸小于弹性盒子元素的尺寸,则会向两个方向溢出相同的长度)。
- baseline
如弹性盒子元素的行内轴与侧轴为同一条,则该值与'flex-start'等效。其它情况下,该值将参与基线对齐。
- stretch
如果指定侧轴大小的属性值为'auto',则其值会使项目的边距盒的尺寸尽可能接近所在行的尺寸,但同时会遵照'min/max-width/height'属性的限制。
-->
<div class="boss">
<div class="box1">11111</div>
<div class="box2">22222</div>
<div class="box3">33333</div>
</div>
<div class="boxx1"></div>
</body>
</html>
HTML应用
最新推荐文章于 2024-07-25 10:45:42 发布