Home > Web Front-end > CSS Tutorial > How to write css border to rounded border

How to write css border to rounded border

WBOY
Release: 2021-11-12 11:44:56
Original
8357 people have browsed it

Writing method: 1. Add "border-radius: rounded corner value;" style to the border to uniformly set the rounded corner size; 2. Add "border-top-left-radius: rounded corner value;", "border -top-right-radius: fillet value;" and other styles set the four-corner fillet size respectively.

How to write css border to rounded border

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to write css border into rounded border

The basic usage of rounded border (border-radius): border-radius attribute is a Abbreviation attribute, used to set the attributes of four rounded corners.

The most basic usage of the rounded border is to set four rounded corners with the same arc

border-top-left-radius:30px;      //左上角
border-top-right-radius:30px;   //右上角
border-bottom-left-radius:30px;  //右下角
border-bottom-right-radius:30px; //左下角
Copy after login

If the four rounded corners are the same, it can be written as:

border-radius:30px;
Copy after login

Example :

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <style>
            .div1{
margin:0 auto;
background: darkcyan;
width:200px;
height:200px;
border:2px solid darkslategray;
border-radius:30px;
text-align: center;
line-height: 200px;
}
        </style>
    </head>
    <body>
    <div class="div1">圆角边框</div>
    </body>
</html>
Copy after login

Output result:

How to write css border to rounded border

For more programming-related knowledge, please visit: Programming Video! !

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

Related labels:
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