Home >Web Front-end >CSS Tutorial >How to realize a trapezoid in css3
In css, you can use the border and "border-top" attributes to achieve a trapezoidal effect. You only need to add the "border: thickness value solid transparent; border-top: trapezoid height solid trapezoid color;" style to the element, that is Can.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to implement a trapezoid in css3
In css, if we want Create a trapezoidal pattern effect, how to achieve it? The following example explains how to achieve a trapezoidal pattern effect in CSS3.
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{ border:25px solid transparent; border-top: 25px solid red; height: 200px; width: 100px; } </style> </head> <body> <div></div> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of How to realize a trapezoid in css3. For more information, please follow other related articles on the PHP Chinese website!