html - 边界半径不适用于图像

标签 html css

enter image description here

这是我目前拥有的这张图片的代码

border-radius: 10px;
border: 3px solid transparent;
-moz-border-image: -moz-linear-gradient(top, #E2B0C7 0%, #BB96C2 100%);
-webkit-border-image: -webkit-linear-gradient(top, #E2B0C7 0%, #BB96C2 100%);
border-image: linear-gradient(to bottom, #E2B0C7 0%, #BB96C2 100%);
border-image-slice: 10;

我正在尝试使用以下方法绕过边界 Angular :
border-radius: 10px;

但这对我来说并没有拐弯抹 Angular 。任何帮助表示赞赏。先感谢您。

最佳答案

您必须使用 div 并将图像转换为 div。
喜欢这个代码

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8" />
    <style>
        div {
            background: linear-gradient(#ff0000 0%, #b200ff 50%, #ff0000 100%);
            padding: 10px;
            display: inline-block;
            border-radius: 20px;
        }
        img {
            width: 500px;
            border-radius: 20px;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <div>
        <img src="FK8.jpg" />
    </div>
</body>
</html>

此致。

关于html - 边界半径不适用于图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37122511/

相关文章:

javascript - 使用 JavaScript 显示/隐藏 'div'

python - 使用 Flask 和 MySQL 创建事件管理器

jQuery 在背景图像之间淡入淡出

css - 如何为多个背景设置不同的尺寸 "chessboard+center_lines"

html - Bootstrap : Carousel images are not moving

javascript - 纯JS : Multiple Forms Validation with some common Fields/elements and some unique fields/elements

html - 在 CSS 中设置移动页面缩放/缩放

javascript - 在 jQuery 中从多个类中查找特定类

css - 流体布局中像素大小元素的精确中心 Twitter Bootstrap

javascript - 单击浏览器中的最大化或最小化按钮时启用调整图标大小