问题:css3做圆角右边是圆角左边是直角
解答:注意css改动这里,nav ul li{ float:left; margin:0 20px; background-color:#999;border-radius:10px 0 0 10px; -moz-border-radius:10px 0 0 10px; font-size:30px;}
理解:border-radius属性
1)border-radius:10px;等价于:border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:10px;border-bottom-left-radius:10px;
2)border-radius:1px 2px 3px 4px; 等价于:border-top-left-radius:1px;border-top-right-radius:2px;border-bottom-right-radius:3px;border-bottom-left-radius:4px;
纠错:您的html代码不全,我补全并修改后的代码如下,请查看~
html>
body{ background-color: #F2F2F2;}
header {background-color:#333;border-radius:10px;}
nav{ display:block; background-color:#333; width:840px ;margin:0 50px 0 0; padding:0 10px 20px 5px;}
nav ul { list-style:none; background-color:#999;}
nav ul li{ float:left; margin:0 20px; background-color:#999;border-radius:10px 0 0 10px; -moz-border-radius:10px 0 0 10px; font-size:30px;}
nav ul li a{ color:#FFF; text-decoration:none; font-size:20px; }
nav ul li a:hover{color:#000 ;text-decoration:none; border-bottom:1px solid #ff5400; padding-bottom:2px;}