我用一张 SVG 图片文件作为背景,代码如下:
{{article.title}}
{{article.date | timeago}} | Tags: {{article.tags}} | Author: {{article.author}}
.content {
color: white;
margin: 0 auto;
margin-top: 50px;
padding: 0 2em;
max-width: 800px;
background-image: url("/static/img/article-border.svg");
background-repeat: no-repeat;
-webkit-background-size: 100% 100%;
}
这张SVG图片就是下图效果中的框。
出来的效果是这样的:
这明显没有充满整个 p…… 这是怎么回事?我该怎么弄?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
contain不是填充满的意思啊。
详情见:http://demo.doyoe.com/css3/background-size/
试试直接用 CSS 来实现图片的效果?