一、边框圆角 (border-radius)
border-radius:角圆半径;
一个参数:全局
两个参数:左上和右下 右上和左下
三个参数:左上 右上和左下 右下
四个参数:左上 右上 右下 左下
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> div { width: 100px; height: 100px; border: 1px solid red; border-radius: 20px; background: red; } </style> </head> <body> <div></div> </body> </html> |
效果:
border-radius: 20px; border-radius:50%; border-radius: 20px 40px;
二、盒子的阴影box-shadow
box-shadow:0px 0px 0px 0px #ffffff; (下移、右移、阴影、边框、颜色)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> div { width: 100px; height: 100px; background: red; box-shadow:0px 0px 5px 1px black; } </style> </head> <body> <div></div> </body> </html> |
效果:
box-shadow:0px 0px 5px 1px black; box-shadow:10px 10px 5px 1px black;