Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/74.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_Rounded Corners - Fatal编程技术网

CSS中的导航栏圆形图像

CSS中的导航栏圆形图像,css,rounded-corners,Css,Rounded Corners,我正在用CSS创建一个导航栏。导航栏有一个背景图像,我希望图像有圆角。我已经尝试过其他方法,比如-moz,但到目前为止都没有效果。以下是我的CSS: ul{ background-image: url(nav_bar.png); height: 60px;width: 35%; background-repeat: no-repeat; position: relative; margin:1; padding:0; left: 30%; } 我

我正在用CSS创建一个导航栏。导航栏有一个背景图像,我希望图像有圆角。我已经尝试过其他方法,比如
-moz
,但到目前为止都没有效果。以下是我的CSS:

ul{
    background-image: url(nav_bar.png); height: 60px;width: 35%;
    background-repeat: no-repeat;
    position: relative;
    margin:1;
    padding:0;
    left: 30%;
}
我怎样才能给它圆角


谢谢

使用
边框半径
背景剪辑:填充框。这两个属性都需要特定于浏览器的前缀,除非包含类似的内容

您添加的CSS如下所示:

ul {
    -moz-border-radius: 10px; /*increase the value to make it more round*/
    -webkit-border-radius: 10px;
    border-radius: 10px;
    -moz-background-clipping: padding-box;
    -webkit-background-clipping: padding-box;
    background-clipping: padding-box;
}

使用
边框半径
背景剪裁:填充框。这两个属性都需要特定于浏览器的前缀,除非包含类似的内容

您添加的CSS如下所示:

ul {
    -moz-border-radius: 10px; /*increase the value to make it more round*/
    -webkit-border-radius: 10px;
    border-radius: 10px;
    -moz-background-clipping: padding-box;
    -webkit-background-clipping: padding-box;
    background-clipping: padding-box;
}

为什么不把图像本身改成圆角,而不是用CSS“事后”处理呢,因为它是一个不重复的背景图像?有各种js库可以帮助实现跨浏览器的兼容性为什么你不把图像本身改成圆角,而不是用CSS“事后”处理呢,因为它是一个不重复的背景图像?有各种js库,这将有助于跨浏览器的兼容性