我一直在努力實現跨瀏覽器的解決方案圓角即使演示工作在所有的瀏覽器,當我嘗試實現它自己的代碼,它在所有瀏覽器作品除 IE8。CSS和跨瀏覽器的圓角
這裏是我的CSS:
body { background:#ffffff url("images/bg.gif") repeat-x ;
font-family:verdana,helvetica,sans-serif ;
font-size:12px ;
color:#000000 ;
margin:0 auto ;
padding:0 ;
}
.clear { clear:both } /* clears floats */
/* #container defines layout width and positioning */
#container { width:1000px ;
margin:auto ;
position:relative ;
z-index:inherit ;
zoom:1 ; /* enables rounded corners in IE6 */
}
#header { width:1000px ;
height:75px ;
padding:10px 0px 10px 0px ;
}
#header-logo { float:left ;
width:255px ;
height:55px ;
background:url("http://template.sophio.com/images/logo.png") no-repeat ;
}
#header-phone { float:left ;
display:block ;
line-height:55px ;
background:url("images/header-phone-bg.png") no-repeat ;
background-position:0px 0px ;
font-size:28px ;
color:#900 ;
font-weight:bold ;
padding-left:50px ;
margin:0px 0px 0px 120px ;
}
#header-right { float:right ;
width:225px ;
}
#header-right-translate { display:block ;
text-align:right ;
background:#ffffff ;
line-height:26px ;
}
#header-right-social { display:block ;
text-align:right ;
background:#FF9 ;
line-height:24px ;
margin-top:5px ;
}
#navbar { width:1000px ;
height:32px ;
background:#9d9687 url("images/header-bg.gif") repeat-x ;
border:1px solid #494437 ;
-moz-border-radius: 11px 11px 0px 0px ;
-webkit-border-radius: 11px 11px 0px 0px ;
border-radius: 11px 11px 0px 0px ;
behavior: url("border-radius.htc");
}
,這裏是我的HTML:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Two Column Right</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="header">
<div id="header-logo"></div>
<div id="header-phone">888-563-2591</div>
<div id="header-right">
<div id="header-right-translate">
[Google Translate Widget Here]
</div>
<div id="header-right-social">
[Social Icons Widget Here]
</div>
</div>
</div>
<div id="navbar">text</div>
</div>
</body>
</html>
導航欄就是我申請圓角。
在IE8中,我所有的角落是圓的,而我只想左上角和右下角要舍(它們顯示正確的,但在所有IE8)。
http://www.w3schools.com/cssref/css3_pr_border-radius.asp - 邊界半徑不IE8發揮好。 – FiveTools 2012-04-12 02:09:17
behavior:url(「border-radius.htc」);將只適用於所有四個角落。這可能是用於獲取圓角在IE8你唯一的選擇:從使用圖像 – kmb64 2012-04-12 02:18:59
親愛的看到我的答案,讓我知道如果任何問題http://snook.ca/archives/html_and_css/rounded_corners_experiment_ie/分開。 – w3uiguru 2012-04-12 02:50:59