CSS中的border-radius屬性

CSS | 邊界半徑屬性 (CSS | border-radius Property)

The border-radius property is commonly used to convert box elements into circles. We can convert box elements into the circle element by setting the border-radius to half of the length of a square element.

border-radius屬性通常用于將框元素轉換為圓形。 通過將邊框半徑設置為正方形元素長度的一半,我們可以將框元素轉換為圓形元素。

Syntax:

句法:

Element {
Width: 150px;
Height: 150px;
border-radius: 50%;
}

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
p {
background: #73AD21;
width: 200px;
height: 150px;
border-radius: 50%
}
</style>
</head>
<body>
<h1>CSS Rounded Corners</h1>
<p></p>
</body>
</html>

Output

輸出量

Border Radius Property in CSS | Example 1

In the above example, 50% border-radius is applied to all the corners.

在上面的示例中,將50%的邊界半徑應用于所有角。

1)具有一個值的border-radius屬性 (1) border-radius property with one value)

The property takes a single value to the border-radius and that value is applied to all the four corners and the corners are rounded equally.

該屬性對邊界半徑采用單個值,并且該值應用于所有四個角,并且這些角均等地舍入。

Syntax:

句法:

Element {
border-radius: 15px;
}

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 2px solid red;
padding: 10px;
border-radius: 25px;
}
</style>
</head>
<body>
<div>
<p>Border Radius in CSS</p>
</div>
</body>
</html>

Output

輸出量

Border Radius Property in CSS | Example 2

In the above example, the border-radius of 25px is applied to all four sides equally.

在上面的示例中, 邊界半徑 25px均等地應用于所有四個側面。

2)具有兩個值的border-radius屬性 (2) border-radius property with two values)

This property takes two values to the border-radius. The first value is applied to top-left and bottom-right corners, the second value is applied to top-right and bottom-left corners.

此屬性將border-radius取兩個值。 第一個值應用于左上角和右下角 ,第二個值應用于右上角和左下角 。

Syntax:

句法:

Element {
border-radius: 15px 10px;
}

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 2px solid red;
padding: 10px;
border-radius: 60px 30px;
}
</style>
</head>
<body>
<div>
<p>Border Radius in CSS</p>
</div>
</body>
</html>

Output

輸出量

Border Radius Property in CSS | Example 3

In the above example, the border-radius of 60px is applied to top-left and bottom-right and 30px is applied to top-right and bottom-left corners.

在上面的示例中, 邊框半徑 60px應用于左上角和右下角,而30px應用于右上角和左下角 。

3)具有三個值的border-radius屬性 (3) border-radius property with three values)

This property takes three values to the border-radius. The first value is applied to the top-left corner and the second value is applied to top-right and bottom-left corners, and the third value is applied to the bottom-right corner.

該屬性將border-radius取三個值。 所述第一值被施加到左上角和所述第二值被施加到右上和左下的角,并且所述第三值被施加到右下角 。

Syntax:

句法:

Element {
border-radius: 15px 10px 30px;
}

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 2px solid green;
padding: 10px;
border-radius: 60px 30px 20px;
}
</style>
</head>
<body>
<div>
<p>Border Radius in CSS</p>
</div>
</body>
</html>

Output

輸出量

Border Radius Property in CSS | Example 4

In the above example, border-radius of 60px is applied to top-left corner, 30px is applied to top-right and bottom-left corners and 20px is applied to bottom-right corner.

在上面的例子中,60像素 邊界半徑被施加到左上角 ,30像素被施加到右上和左下的角和20像素被施加到右下角 。

4)具有四個值的border-radius屬性 (4) border-radius property with four values)

This property takes four values to the border-radius and applies four different values to each of the corners. The first value is applied to the top-left corner, the second value is applied to the top-right corner, the third value is applied to the bottom-right corner and the fourth value is applied to the bottom-left corner.

此屬性將四個值應用于邊界半徑 ,并將四個不同的值應用于每個角。 所述第一值被施加到左上角 ,第二值被施加到右上角 ,第三值被施加到右下角和第四值被施加到左下角 。

Syntax:

句法:

Element {
border-radius: 15px 10px 20px 5px;
}

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
div {
border: 2px solid green;
padding: 10px;
border-radius: 60px 30px 50px 10px;
}
</style>
</head>
<body>
<div>
<p>Border Radius in CSS</p>
</div>
</body>
</html>

Output

輸出量

Border Radius Property in CSS | Example 5

In the above example, 60px is applied to top-left corner, 30px is applied to the top-right corner, 50px is applied to bottom-right corner and 10px is applied to bottom-left corner of the box.

在上述例子中,60像素被施加到左上角 ,30像素被施加到右上角 ,50像素被施加到右下角和10px的被施加到盒的左下角 。

翻譯自: https://www.includehelp.com/code-snippets/the-border-radius-property-in-css.aspx

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/378141.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/378141.shtml
英文地址,請注明出處:http://en.pswp.cn/news/378141.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【C++ grammar】Enhancement for Type System (C++11 對類型系統的增強)

數據類型 (Data type) int, long int, double, struct, char *, float [], int (*f)()… 計算機程序構造塊 計算機程序構造塊是不同大小粒度的計算機程序組成部分&#xff0c;它包括變量、表達式、函數或者模塊等。 類型系統 (Type System) 類型系統&#xff1a;在編程語言中…

.net romoting 的EventWrapper類

.net romoting 的EventWrapper類 注意&#xff1a;防火墻的問題 --------------------------------------------------- //定義廣播服務接口 [Serializable] public delegate void BroadCastEventHandler(string info); public interface IBroadCastService {…

一、織物組織相關基本概念

一、織物形成的五大運動&#xff1a;開口、引緯、打緯、送經、卷取 開口運動&#xff08;先開口讓織物形成上下兩層&#xff09; 引緯運動&#xff08;在上下兩層經紗之間進行引緯&#xff0c;把緯紗穿入上下兩層經紗之間&#xff0c;從而實現經紗緯紗之間的交織&#xff09; …

達爾豪斯大學計算機科學世界排名,達爾豪斯大學成了全加最好,這又是個什么排名?...

原標題&#xff1a;達爾豪斯大學成了全加最好&#xff0c;這又是個什么排名&#xff1f;沒有“八大”的知名&#xff0c;沒有“常春藤”的受寵&#xff0c;雖然它只是眾多名校中的普通一個&#xff0c;但只要你對它有個稍微的了解&#xff0c;你一定會愛上它的&#xff01;它雖…

tag標簽記錄

看到項目代碼中有一個自定義的tag標簽&#xff0c;想起以前自己寫過的標簽&#xff0c;竟然忘記的差不多了&#xff0c;手一癢&#xff0c;自己寫個簡單的tag標簽&#xff0c;回顧一下歷史知識 首先建一個servlet工程&#xff0c;然后寫個index.jsp&#xff0c;項目跑起來&…

java類只讀怎么辦_如何在Java中制作一個只讀類?

java類只讀怎么辦The question is that "can we make a read-only class in Java?" 問題是“我們可以用Java制作一個只讀類嗎&#xff1f;” The answer is: "Yes, we can make a read-only in java." 答案是&#xff1a; “是的&#xff0c;我們可以在J…

LeetCode 53:最大子序和解題以及優化思路(第一次獨立刷題記錄)

給定一個整數數組 nums &#xff0c;找到一個具有最大和的連續子數組&#xff08;子數組最少包含一個元素&#xff09;&#xff0c;返回其最大和。 示例: 輸入: [-2,1,-3,4,-1,2,1,-5,4] 輸出: 6 解釋: 連續子數組 [4,-1,2,1] 的和最大&#xff0c;為 6。 進階: 如果你已經實現…

NHibernate 的 ID 標識選擇器

在 Hibernate 中&#xff0c;每個對象需要一個標識 ID&#xff0c;通過這個標識 ID 建立對象與數據庫中記錄的對應關系。 Nhibernate 提供了多種方式來建立這個 POID。基于不同的生成策略&#xff0c;可以選擇更佳的方式。 首先是賦值方式&#xff1a;assigned&#xff0c;這種…

三、規則組織的衍生組織——經山形組織數學模型的建立

基礎概念公式推到可參考該專欄下的前幾篇博文。 經山形組織圖&#xff1a; 左半部分&#xff1a;&#xff0c;3上2下1上2下&#xff0c;右斜&#xff0c;飛數為1 右半部分&#xff1a;&#xff0c;3上2下1上2下&#xff0c;左斜&#xff0c;飛數為-1 左右兩部分只有飛數是相…

c語言 函數的參數傳遞示例_scalbln()函數以及C ++中的示例

c語言 函數的參數傳遞示例C scalbln()函數 (C scalbln() function) scalbln() function is a library function of cmath header. It scales the significand using floating-point base exponent (long int) i.e. it is used to calculate the product of the given signific…

上周熱點回顧(7.8-7.14)

熱點隨筆&#xff1a; MingQQ v1.0高仿版開源了&#xff0c;使用WebQQ協議實現了QQ客戶端基本的聊天功能...&#xff08;ZYM&#xff09; 我的新書&#xff0d;&#xff0d;《從員工到經理人》&#xff08;Jimmy Zhang&#xff09; MVC實用架構設計&#xff08;三&#xff0…

儲存過程生成器

/Files/qanholas/SPGen_ReleaseCandidate1_Binaries.zip ---- Dropping stored procedure sp_費用表_SelectAll : --IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id OBJECT_ID(N[sp_費用表_SelectAll]) AND OBJECTPROPERTY(id, NIsProcedure) 1)DROP PROCEDURE [dbo].[sp…

基于計算機控制的溫度檢測系統,基于專用溫度傳感的溫度檢測系統.doc

基于專用溫度傳感的溫度檢測系統摘 要 在現代工業領域溫度檢測系統是指用某種方式顯示出當前的環境溫度。傳統使用PTC或NTC電阻作為溫度傳感器的方式在使用過程中存在著很多不足之處比如所采集溫度的精度比較低、系統的可靠性差、設計難度較大、整體設計成本較高等缺點已…

LeetCode 121:買賣股票的最佳時機 思考分析

題目描述&#xff1a; 給定一個數組&#xff0c;它的第 i 個元素是一支給定股票第 i 天的價格。 如果你最多只允許完成一筆交易&#xff08;即買入和賣出一支股票一次&#xff09;&#xff0c;設計一個算法來計算你所能獲取的最大利潤。 注意&#xff1a;你不能在買入股票前賣出…

四、規則組織的衍生組織——經向破斜組織數學模型的建立

基礎概念公式推到可參考該專欄下的前幾篇博文。 經向破斜組織圖&#xff1a; 左半部分&#xff1a;&#xff0c;3上2下1上2下&#xff0c;右斜&#xff0c;飛數為1 右半部分&#xff1a;&#xff0c;2上1下2上3下。左斜&#xff0c;飛數為-1 左右兩部分&#xff0c;經緯紗組織…

EASYUI+MVC4通用權限管理平臺

通用權限案例平臺在經過幾年的實際項目使用&#xff0c;并取得了不錯的用戶好評。在平臺開發完成后&#xff0c;特抽空總結一下平臺知識&#xff0c;請各位在以后的時間里&#xff0c;關注博客的更新。 1.EASYUIMVC4通用權限管理平臺--前言 2.通用權限管理平臺--架構選型 3.通用…

int max+1小于0_INT_MAX常數,C ++中的示例

int max1小于0C INT_MAX宏常量 (C INT_MAX macro constant) INT_MAX constant is a macro constant which is defied in climits header, it is used to get the maximum value of a signed int object, it returns the maximum value that a signed int object can store, wh…

在計算機領域客觀事物的屬性表示為數據,數據與信息試題解析

一圖看懂數據與信息1、在計算機領域&#xff0c;信息是經過轉化而成為計算機能夠處理的__________。A&#xff0e;數據B&#xff0e;符號C&#xff0e;圖形D&#xff0e;數字答案&#xff1a;A。解析&#xff1a;本題考查有關信息基本概念的知識。信息是人們由客觀事物得到的。…

Mysql Data 目錄和 Binlog 目錄 搬遷

Mysql5.1.38 Data 目錄和 Binlog 目錄 搬遷 [mysql-bin.index not found (Errcode: 2)]Leave a comment Go to comments剛開始安裝時使用了默認目錄&#xff0c;使用一段時間&#xff0c;數據慢慢變在&#xff0c;發現當前設置的目錄空間不夠時&#xff0c;就要搬遷數據到另一個…

【數據結構基礎】【散列表】

散列表也叫做哈希表(hash table),這種數據結構提供了鍵(key)和值(value)的映射關系。只要給出一個key&#xff0c;就可以高效查找它匹配的value&#xff0c;時間復雜度接近O(1); 哈希函數 哈希函數通過某種方式&#xff0c;把key和數組下標進行轉換。 在java中&#xff0c;每…