Skip to content
Snippets Groups Projects
Commit 69f075e0 authored by Yulong Wang's avatar Yulong Wang
Browse files

Delete main.css

parent 08e2a1dd
No related branches found
No related tags found
No related merge requests found
.header{
/*设置容器的大小,然后让容器内的图片不会超出去*/
border-color: black;/*可视化边框范围用*/
border-style: solid;
width: 100%;
height: 120px;
overflow: hidden;
/*图片超出容器的部分隐藏掉 */
position: relative;
/*这个postion是用于规范,因为img的header的子类,子类的position写的absolute是相对于父类的absolute,规范写法需要加上*/
}
/*将图片按照容器的大小进行适配,统一高度并居中*/
.header img{
height: 120px;
position: absolute;
/*设置图片是绝对位置,并且是绝对是从容器的左一半的位置开始显示*/
left: 50%;
transform: translateX(-50%);
transform是移动属性,X轴移动-50% 也就是向左移动一半的距离,这样就一定是居中显示的图片
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment