今日总结:css模块自适应浏览器页面居中以及模块立体

width:400px;
height:500px;
position:absolute;
left:50%;
top:50%;
margin-left: -200px;
margin-top: -250px;

 

原理:先设置长宽,然后定位为绝对位置,left和top分别为50%可以让模块的左上角位于页面中心,margin-left和margin-top的设置分别让模块向左边和上边移动它自身长宽的一半。

 

 

box-shadow

box-shadow:5px 2px 6px #000;
数值从左至右:阴影水平偏移值(正值向右,负值向左);阴影垂直偏移值(正值向下,负值向上);阴影模糊值;阴影颜色。

posted @ 2022-03-13 23:06  stdrush  阅读(84)  评论(0)    收藏  举报