在css中怎样让边角具有弧度

html-css012

在css中怎样让边角具有弧度,第1张

在css中,让边角具有弧度只需要用border-radius这个属性。

如图,这是一个测试页面,它们的边角分别为25PX和50PX半径的圆角。

写法像这样:

border-radius:25px

测试代码如下

<div style="border-radius:25px"></div>

<div style="border-radius:50px"></div>

div{

width:200px

height:130px

background-color:wheat

margin-bottom:10px

}

拓展资料-css3简介

在CSS3推出前,圆角效果需要用图片实现,下面简要介绍CSS3。

CSS3是CSS(层叠样式表)技术的升级版本,于1999年开始制订,2001年5月23日W3C完成了CSS3的工作草案,主要包括盒子模型、列表模块、超链接方式、语言模块、背景和边框、文字特效、多栏布局等模块。

CSS演进的一个主要变化就是W3C决定将CSS3分成一系列模块。浏览器厂商按CSS节奏快速创新,因此通过采用模块方法,CSS3规范里的元素能以不同速度向前发展,因为不同的浏览器厂商只支持给定特性。但不同浏览器在不同时问支持不同特性,这也让跨浏览器开发变得复杂。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<html>

<head>

<style>

#aa{

float:left}

#main_footer_zw {text-align:leftmargin-bottom:8pxfloat: leftwidth: 690px}

#main_footer_zw ul {display:inlinemargin:0 autotext-align: leftfloat: leftpadding-top: 0padding-right: 0padding-left:1pxmargin-top:4px}

#main_footer_zw ul li {float:leftdisplay:inlinewidth:224pxfloat:lefttext-align:leftmargin-top: 8pxmargin-bottom: 0pxmargin-left: 2pxpadding: 0px}

#main_footer_zw ul li a {float:leftdisplay:inlinefloat: none}

#main_footer_zw ul li img { margin-bottom:1px}

</style>

<title</title>

<body>

<div id="main_footer_zw">

<ul>

<li><a href="#"><img class="aa" src="images/cy_06_08.jpg" width="224" height="180" border="0" onMouseOver="this.src='images/cy_06_08x.jpg'" onMouseOut="this.src='images/cy_06_10.jpg'"/></a>

</li>

<li><a href="#"><img src="images/cy_06_10.jpg" width="224" height="180" border="0" onMouseOver="this.src='images/cy_06_10x.jpg'" onMouseOut="this.src='images/cy_06_10.jpg'"/></a>

</li>

<li><a href="#"><img src="images/cy_06_12.jpg" width="224" height="180" border="0" onMouseOver="this.src='images/cy_06_12x.jpg'" onMouseOut="this.src='images/cy_06_12.jpg'"/></a>

</li>

</ul>

</div>

</body>

</html>