Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write rounded rectangles by css

2025-05-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to write a rounded rectangle by css". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Method: 1. Use width and height attributes to set the element style to rectangle, syntax "element {width: width value; height: height value;}". 2. Use the "border-radius" attribute to set the fillet style for the rectangular element. Syntax "element {border-radius: fillet value;}".

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

How to write a rounded rectangle by css

In css, you can use the border-radius attribute to write the rounded rectangle style, which sets the fillet style for the four corners of the element.

The syntax is as follows:

Border-radius: 1-4 length |% / 1-4 length |%

Examples are as follows:

Div {width:200px; height:100px; border:1px solid black; border-radius:20px;}

Output result:

This is the end of "how to write rounded rectangles by css". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report