学习CSS的边框

原创 2018-11-21 17:56:01 234
摘要:一、边框样式:solid:实线  dashed:虚线  dotted:点状虚线  doble:双线二、边框形状:可以用bolder-radius,通过数值来调样式。例如一个宽高为100px的图形,border-radius:50px 可以显示为圆形。三:边框颜色:可以用border-top、border-bottom、border-left、border-right来

一、边框样式:solid:实线  dashed:虚线  dotted:点状虚线  doble:双线

二、边框形状:可以用bolder-radius,通过数值来调样式。例如一个宽高为100px的图形,border-radius:50px 可以显示为圆形。

三:边框颜色:可以用border-top、border-bottom、border-left、border-right来控制单边边框

四:边框阴影:box-shadow;一般有4个值,分别为X轴方向阴影位置、y轴方向阴影位置、阴影厚度和阴影颜色。也可以用inset来设置内阴影。

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>学习CSS的边框</title>

<link rel="shortcut icon" type="image/x-icon" href="image/3.jpg">

<link rel="stylesheet" type="css" href="css/boder.css">

<style type="text/css">

.box{width: 100px;height: 100px;border: 1px dotted yellow}

.main{width:200px;height: 200px;border-top: 2px double pink;border-left: 2px solid #ccc;border-bottom:0.5px solid yellow;border-radius: 100px}

.shadow{width: 300px;height: 50px;border: none;border-radius:50px;box-shadow: 0px 8px 5px pink}

</style>


</head>

<body>

    <div class="box"></div>

    <div class="main"></div>

    <div class="shadow"></div>

</body>

</html>


批改老师:灭绝师太批改时间:2018-11-21 17:58:05
老师总结:完成的很好,刚刚开始学习难免枯燥,后面就好了,继续保持!

发布手记

热门词条