How to express the dotted box in css: 1. "Element {border-style:dashed;}", the "dashed" value means setting the border to a dotted style; 1. "Element {border-style:dotted" ;}", the "dotted" value means to set the border to a dotted style.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to express the dotted box in css
There are two ways to express the dotted box in css.
1. Use border-style: dashed; style, the example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style type="text/css"> div{ width:100px; height:100px; background-color:red; border-style: dashed; } </style> </head> <body> <div> </div> </body> </html>
Output result:
2. Use border- style: dotted; style, the example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style type="text/css"> div{ width:100px; height:100px; background-color:red; border-style: dotted; } </style> </head> <body> <div> </div> </body> </html>
Output result:
## (Learning video sharing:css video tutorial)
The above is the detailed content of How to express dotted box in css. For more information, please follow other related articles on the PHP Chinese website!