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.mzph.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;每…