Home > Web Front-end > CSS Tutorial > How to set css shadow border

How to set css shadow border

coldplay.xixi
Release: 2021-03-01 16:48:39
Original
5417 people have browsed it

How to set the css shadow border: first create a new html file; then create two [

] on this html file to set the shadow border; finally add the style class to these two divs as in , out.

How to set css shadow border

The operating environment of this tutorial: windows10 system, css3 version, DELL G3 computer. This method is suitable for all brands of computers.

How to set the css shadow border:

1. Open the front-end development tool, create a new html file, and then create two

on this html file. Used to set the shadow border, the last two divs add style classes: in, out. As shown in the picture:

Code:

<div class="out">外部边框阴影</div>
<div class="in">内部边框阴影</div>
Copy after login

How to set css shadow border

2. Set the border shadow. Set the size, width and height of these two style classes, and finally use box-shadow to set the shadow border. As shown in the picture:

css code:

<style type="text/css">
.out,.in{
width:300px;
height: 150px;
border:1px solid #BFBFBF;
margin: 20px auto;
}
.out{
box-shadow:0px 0px  10px 5px #aaa;
}
.in{
box-shadow:0px 0px 10px 5px #aaa inset;
}
</style>
Copy after login

How to set css shadow border

3. After saving the html file, open it with a browser to see the effect. As shown in the picture:

How to set css shadow border

4. All codes. You can directly copy all the code to the new html file, paste and save it and open it with a browser to see the effect.

All codes:






<style type="text/css">
.out,.in{
width:300px;
height: 150px;
border:1px solid #BFBFBF;
margin: 20px auto;
}
.out{
box-shadow:0px 0px  10px 5px #aaa;
}
.in{
box-shadow:0px 0px 10px 5px #aaa inset;
}
</style>

<div class="out">外部边框阴影</div> <div class="in">内部边框阴影</div>
Copy after login

Related tutorial recommendations:CSS video tutorial

The above is the detailed content of How to set css shadow border. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template