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

How to write css border to rounded border

WBOY
WBOYOriginal
2021-11-12 11:44:568292browse

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; //左下角

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

border-radius:30px;

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>

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!

Statement:
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