gpt4 book ai didi

html - 自定义边框 css 和背景图片

转载 作者:行者123 更新时间:2023-11-28 16:39:59 26 4
gpt4 key购买 nike

我正在使用 border-image 标签在 css 中创建自定义边框。我使用的背景颜色与边框颜色相同。但它并没有填满整个高度。

<!DOCTYPE html>
<html>
<head>
<style>

div{
border:15px solid transparent;
width:250px;
}

div p {
background-color: #74c7a9;
padding-right: 20px;
padding-bottom: 20px;
}


#round {
-webkit-border-image:url(border2.png) 30 30 round; /* Safari 5 */
-o-border-image:url(border2.png) 30 30 round; /* Opera */
border-image:url(border2.png) 30 30 round;
}

</style>
</head>
<body>


<div id="round">
<p>Here, the image is tiled (repeated) to fill the area.
</p>
</div>

</body>
</html>

最佳答案

你可能应该以问题的形式提问(我猜这就是为什么这被否决了),但我认为你正在寻找 CSS 属性 box-sizing: border-box .

这里有关于 box-sizing 的 MDN 文章:https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing

关于html - 自定义边框 css 和背景图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22672271/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com