CSS - border-end-start-radius 属性



CSS border-end-start-radius 属性定义元素块级末端和内联起始端之间角的半径。此属性是逻辑边框半径,这意味着其值取决于元素的书写模式、方向和文本方向。

语法

border-end-start-radius: 0 | length | percentage | initial | inherit;

属性值

描述
0 它不显示任何圆角效果。默认值。
长度 它使用长度值定义块级末端和内联起始端角的圆度。
百分比 它使用百分比值定义块级末端和内联起始端角的圆度。
initial 这将属性设置为其默认值。
inherit 这从父元素继承属性。

Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your career.

CSS 边框末端起始半径属性示例

以下示例使用不同的值解释了 border-end-start-radius 属性。

边框末端起始半径为零值

为了不在块的末端和内联角的起始处有任何圆角效果,我们可以使用 0。在以下示例中,使用了 0 值。

示例

Open Compiler
<!DOCTYPE html> <html> <head> <style> .rounded-box { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 0; } </style> </head> <body> <h2> CSS border-end-start-radius property </h2> <div class="rounded-box"> No rounded corner for block-end and inline-start corner. </div> </body> </html>

边框末端起始半径为长度值

为了在块的末端和内联角的起始处产生圆角效果,我们可以使用长度值(例如 10px)来指定半径。在以下示例中,使用了 80px 值。

示例

Open Compiler
<!DOCTYPE html> <html> <head> <style> .rounded-box1 { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 80px; } .rounded-box2 { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 80px 80px; } </style> </head> <body> <h2> CSS border-end-start-radius property </h2> <p class="rounded-box1"> Rounded corner for block-end and inline-start corner with single value. </p> <p class="rounded-box2"> Rounded corner for block-end and inline-start corner with two values. </p> </body> </html>

边框末端起始半径为百分比值

为了在块的末端和内联角的起始处产生圆角效果,我们可以使用百分比值(例如 10%)来指定半径。在以下示例中,使用了 50% 值。

示例

Open Compiler
<!DOCTYPE html> <html> <head> <style> .rounded-box1 { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 50%; } .rounded-box2 { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 50% 50%; } </style> </head> <body> <h2> CSS border-end-start-radius property </h2> <p class="rounded-box1"> Rounded corner for block-end and inline-start corner with single value. </p> <p class="rounded-box2"> Rounded corner for block-end and inline-start corner with two values. </p> </body> </html>

带方向的边框末端起始半径

border-end-start-radius 上下文中,direction 参数决定要圆哪个角。在 LTR 方向中,左下角是圆的,而在 RTL 方向中,右下角是圆的。LTR 是默认方向。这些在以下示例中显示。

示例

Open Compiler
<!DOCTYPE html> <html> <head> <style> #right { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 120px 60px; direction: ltr; } #left { width: 150px; height: 150px; border: 3px solid green; border-end-start-radius: 120px 60px; direction: rtl; } </style> </head> <body> <h2> CSS border-end-start-radius property </h2> <p id="right"> block-end and inline-start rounded corner using direction: ltr </p> <p id="left"> block-end and inline-start rounded corner using direction: rtl </p> </body> </html>

带书写模式的边框末端起始半径

border-end-start-radius 属性可以与 writing-mode: vertical-lr 一起使用,它将文本从上到下、从左到右垂直排列。类似地,使用 writing-mode: vertical-rl,它将文本从上到下、从右到左垂直排列。这些在以下示例中显示。

示例

Open Compiler
<html> <head> <style> .rounded-box { width: 150px; height: 150px; border: 3px solid green; margin: 10px; } .top-left-lr { border-end-start-radius: 30%; writing-mode: vertical-lr; } .top-left-rl { border-end-start-radius: 30%; writing-mode: vertical-rl; } </style> </head> <body> <h2> CSS border-end-start-radius property</h2> <div class="rounded-box top-left-lr"> block-end and inline-start rounded corner using vertical-lr. </div> <div class="rounded-box top-left-rl"> block-end and inline-start rounded corner using vertical-rl. </div> </body> </html>

支持的浏览器

属性 Chrome Edge Firefox Safari Opera
border-end-start-radius 89.0 89.0 66.0 15.0 75.0
css_properties_reference.htm
广告