#id001{
color: fuchsia; /* 设置字体颜色*/
font-size: 30px; /* 设置字体大小*/
border: 3px red solid ; /* 设置边框颜色粗细和虚实线*/
width: 300px;
height: 300px; /* 边框长宽*/
background-color: #800080; /* 背景颜色*/
/*让div边框居中*/
margin: auto;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
/*设置字体在方框内居中*/
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
打印效果