圆角矩形加阴影

2018-05-27  本文已影响5人  加油吧_

圆角矩形加阴影

圆角矩形阴影
HTML代码
<div class="box"></div>
CSS代码
div.box{
  width: 200px; 
  height: 100px;          
  border: 1px solid #000;
  border-radius: 10px;
  box-shadow: 2px 2px 2px 2px gray,
             inset -2px -2px 2px 2px gray;
}

圆角

border-radius:左上 右上 右下 左下;
border-radius 有更多的功能,可以做更多的小东西
可以用像素控制 也可以用百分比控制

阴影

box-shadow: inset <offset-x> <offset-y> <blur-radius> <spread-radius> <color>

上一篇 下一篇

猜你喜欢

热点阅读