简体   繁体   English

带有CSS的图像上的圆角

[英]Rounded corners on images with CSS

Did some investigating in this forum and others but I can't quite figure out what the problem I'm having is.. 是否在这个论坛上进行了一些调查,但其他人却无法确定我遇到的问题。

I set a border-radius on an class within a slider and it starts off with rounded corners, but as each image comes through with the next slide, they revert back to non rounded. 我在滑块上的类上设置了边框半径,它以圆角开始,但是随着每个图像在下一张幻灯片中通过时,它们会还原为非圆角。

The website in question is here: http://goo.gl/8i8g2 有问题的网站在这里: http : //goo.gl/8i8g2

and the promo image section is the one I'm having trouble with.. 促销图片部分是我遇到的问题。

Fixed the link 修复链接

I think you need to add: 我认为您需要添加:

.nivo-slice
{
    -webkit-border-radius:15px;
    -moz-border-radius:15px;
    border-radius:15px;
}

to your CSS file. 到您的CSS文件。

Edit: 编辑:

As Edward Ruchevits pointed out below, you may also want to add: 正如Edward Ruchevits在下面指出的那样,您可能还需要添加:

-khtml-border-radius:15px;
-o-border-radius:15px;

to support other browsers. 支持其他浏览器。

And this should work fine in >IE9. 这在> IE9中应该可以正常工作。 You may also want to add <meta http-equiv="X-UA-Compatible" content="IE=edge"> to your header. 您可能还想将<meta http-equiv="X-UA-Compatible" content="IE=edge">到标题中。

By the way, snuffn 's answer is not complete, there are two more options: for old IEs and for Linux users. 顺便说一下, snuffn的答案还不完整,还有两个选择:对于旧IE和Linux用户。

.nivo-slice
{
    behavior: url("border-radius.htc");

       -moz-border-radius: 15px; /* Firefox */
    -webkit-border-radius: 15px; /* Safari and Chrome */
     -khtml-border-radius: 15px; /* Linux browsers */
            border-radius: 15px; /* Opera 10.50, IE and CSS3 */
}

To use behavior , you'll need to download the appropriate file from Google Code . 要使用behavior ,您需要从Google Code下载适当的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM