简体   繁体   English

如何创建背景css div /圆角?

[英]How to create background css div/rounded corners?

How can I create the following html/css style (rounded corners, basic background-color) highlighted in red box: 如何创建以红色框突出显示的以下html / css样式(圆角,基本背景颜色):

在此输入图像描述

Use the border-radius CSS property to create rounded borders: 使用border-radius CSS属性创建圆角边框:

-moz-border-radius: 5px;    /* Firefox 3.6-, removed in Firefox 13 */
-webkit-border-radius: 5px; /* Safari 4-, Chrome 3- */
border-radius: 5px;     /* Firefox 4+, Safari 5+, Chrome 4+, Opera 10.5+, IE9+ */

You can leave out the prefixes, because Firefox 3.6 or old webkit browsers are almost extinct. 你可以省略前缀,因为Firefox 3.6或旧的webkit浏览器几乎绝迹。

Although it's possible to get rounded corners in OldIE (IE8-) using divs+images or PIE.htc , I recommend against it: PIE is not very reliable, and adding several HTML hacks just to get something to work in old IE is a waste. 虽然可以使用div +图像或PIE.htc在OldIE(IE8-)中获得圆角,但我建议不要这样做 :PIE不是很可靠,并且添加几个HTML hacks只是为了让旧IE中的东西工作是浪费。

See also: MDN: border-radius . 另请参见: MDN: border-radius

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM