Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过css实现圆角_Css - Fatal编程技术网

通过css实现圆角

通过css实现圆角,css,Css,我写了一个css作为傻瓜: <style> #box_1 #box1_bg{ width: 100px; padding-left:0px; font-family: "cachet Bold" , "CachetBoldRegular"; font-weight: bold; color: #FFFFFF; text-decoration: none; font-size: 21px; text-align:cente

我写了一个css作为傻瓜:

<style>
#box_1 #box1_bg{
    width: 100px;
    padding-left:0px;
    font-family: "cachet Bold" , "CachetBoldRegular";
    font-weight: bold;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 21px;
    text-align:center;
    padding-top:10px;
    height:30px;
    border-bottom-style:groove;
       -moz-border-radius-bottomleft: 10px;
       -moz-border-radius-bottomright: 10px;
       -webkit-border-bottom-left-radius: 10px;
       -webkit-border-bottom-right-radius: 10px;



}
</style>

#盒子1#盒子1#背景{
宽度:100px;
左侧填充:0px;
字体系列:“cachet Bold”、“CachetBoldRegular”;
字体大小:粗体;
颜色:#FFFFFF;
文字装饰:无;
字号:21px;
文本对齐:居中;
填充顶部:10px;
高度:30px;
边框底部样式:凹槽;
-moz边框半径左下角:10px;
-moz边框半径右下角:10px;
-webkit边框左下半径:10px;
-webkit边框右下半径:10px;
}
它给了我一个盒子一样的结构。。
如何获取此框的圆角?

您需要添加背景或边框才能看到圆角

#box_1 #box1_bg{
    width: 100px;
    padding-left:0px;
    font-family: "cachet Bold" , "CachetBoldRegular";
    font-weight: bold;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 21px;
    text-align:center;
    padding-top:10px;
    height:30px;
    border:5px groove yellow;
    -moz-border-radius-bottomleft: 10px;
    -moz-border-radius-bottomright: 10px;
    -webkit-border-bottom-left-radius: 10px;
    -webkit-border-bottom-right-radius: 10px;
}

如果您不使用支持CSS3的浏览器,则不会看到弯曲的拐角。这包括IE的所有版本,最多8个,包括8个。还要确保定义了
边框颜色
,以便您可以实际看到边框,或者选择
背景颜色
,我使用
边框半径:10px
在FF4、Chrome、Safari和Opera中都可以使用

或者,您可以对每个角的不同半径执行
边界半径:10px 3px 7px 2px

别忘了背景:#000或使您的盒子具有某种外观的东西使用以下样式:

border-radius: 10px 10px;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;

摘自

您在哪个浏览器中预览此内容

请注意,标准css3边界半径属性称为
border radius

您仅将规则应用于mozilla和webkit浏览器

这样的交叉浏览器选择器应该可以:

.round {
-moz-border-radius-bottomleft:10px;
-moz-border-radius-bottomleft:10px;
-webkit-border-bottom-left-radius:10px;
-khtml-border-bottom-right-radius: 10px;
-khtml-border-bottom-left-radius: 10px;
-webkit-border-bottom-right-radius:10px;
-webkit-border-bottom-left-radius:10px;
border-radius:0 0 10px 10px;
/* optional behavior: url(border-radius.htc) */ 
}

注:仅当您需要强制支持IE6-8时才使用.htc文件。

我不理解您的问题,是否希望此元素的所有角都圆角?我假设您在firefox或webkit浏览器上进行测试?您是否尝试过右下角半径:10px;?看一看——这是一个对IE的黑客攻击,它支持
边框半径
(以及更多)。
边框颜色
不需要定义,
背景
会使所有的角落都变圆。此外,边界半径应定义为10px。我发现IE.htc黑客最多也很脆弱,在一些安装上,任何版本,IE都会爆炸。是的,实际上更可靠的解决方案是使用PIEcss3或条件注释和背景图像(这是我测试过的最可靠的方法)。Position relative通常会解决.htc的问题。您可以执行
边框:0px
,但仍有
边框半径,是的