First, Box-shadow properties
Box-shadow can also be used to generate a bounding rectangle, except that it generates a projection, and it accepts the 4th value as the expansion radius, the 0 x-axis is offset by the +0 y-axis offset by the +0 's expansion radius, and the resulting display is the same as the border, but notice that the projection behaves differently from the border, and the projection doesn't affect the layout The "false" border is outside the element and does not affect the element's click (the Box-shadow attribute can be added to the inset element to project into the inner color).
1 <HTML>2 <Head>3 <MetaCharSet= "Utf-8">4 <title>Multiple borders</title>5 <styletype= "Text/css">6 Div{7 width:100px;8 Height:60px;9 margin:25px;Ten background:Yellowgreen; One A Box-shadow:0 0 0 10px #665, - 0 0 0 15px deeppink, - 0 2px 5px 15px rgba (0,0,0,0.6); the } - </style> - </Head> - <Body> + <Div></Div> - </Body> + </HTML>
Second, the outline programme
The Outline property lets you add a border to a border, rather than using Box-shadow, the advantage is that you can specify a different type for the border, not just a solid line; The disadvantage is that you can specify only two layers of borders.
1 <HTML>2 <Head>3 <MetaCharSet= "Utf-8">4 <title>Outline implementing a double border</title>5 <styletype= "Text/css">6 Div{7 width:100px;8 Height:60px;9 margin:25px;Ten background:Yellowgreen; One A Border:10px Solid #665; - Outline:5px Solid Deeppink; - } the </style> - </Head> - <Body> - <Div></Div> + </Body> - </HTML>
[CSS] "CSS Secrets" Learning (ii)-Multiple borders