Web17css样式

一、布局盒子类
width:宽度
height:高度
background-color:背景颜色,简写 background
margin:外边距(盒子和外面别的盒子之间的距离)
margin-top 上外边距、margin-right 右、margin-bottom 下、margin-left 左
padding:内边距(盒子内部文字距离边框的距离)
border:边框
写法:border: 粗细 线条样式 颜色;
例:border: 1px solid #000;
solid:实线
dashed:虚线
box-sizing: border-box:边框和内边距不会撑大盒子尺寸,考试必写
二、文字样式
font-size:文字大小
color:文字颜色
text-align:文字对齐方式
center:居中
left:左对齐
right:右对齐
font-weight:字体粗细
bold:加粗
text-decoration:文字装饰
none:去掉下划线(a 链接专用)
三、Flex 弹性布局(考试大题核心)
display: flex:开启弹性布局
justify-content:水平方向排列方式
center:水平居中
space-between:两边贴边,中间均分空隙
align-items:垂直方向排列
center:垂直居中
四、浮动与清除浮动
float:浮动
left:向左浮
right:向右浮
overflow: hidden:清除浮动塌陷
五、选择器相关单词
class:类,css 用 . 调用
id:编号,css 用 # 调用
*:通配符,全部标签
六、定位 position
position: relative:相对定位
position: absolute:绝对定位
top:距离顶部距离,left:距离左侧距离
七、颜色常用英文简写

fff:白色

000:黑色

red:红色
blue:蓝色

ccc:浅灰色

333:深灰色

posted @ 2026-07-07 08:28  我老爱吃沙琪玛le  阅读(14)  评论(0)    收藏  举报