a)display:flex:如果一个容器设置了这个属性,那么这个盒子里面的所有直接子元素都会自动的变成伸缩项(flex item) b)justify-content:设置或检索弹性盒子元素在主轴(横轴)方向上的对齐方式,语法:justify-content:flex-start I flex-end I center I space- between I space-around
<head> <style> div { width: 300px; height: 200px; /*添加径向渐变:产生也是图像*/ /*background:radial-gradient(red,blue);*/ /*语法:radial-gradient(形状大小坐标): 形状shape:circle:产生正方形的渐变色ellipse:适配当前的形状,如果是正方形的容器,两者效果一样 at position:坐标,默认在正中心。可以赋值坐标(参照元素的左上角),也可以赋值关键字(left center right top bottom) 大小size:closest-side:最近边;farthest-side:最远边;closest-corner:最近角;farthest-corner:最远角。默认是最远的角farthest-corner*/ /*background:radial-gradient(circle,red,blueI;*/ /* background: radial-gradient(circle at 50px 50px, red, blue); */ /*background:radial-gradient(at left top,red,blue);*/ /* 设置颜色的位置 */ background: radial-gradient(red, red 50%, blue 50%, blue); } </style> </head>