【发布时间】:2016-10-26 01:43:05
【问题描述】:
我希望实现的是显示具有透明背景层的图像,该图像将位于背景上,该背景将具有白色边框和灰色框,位于图像区域的中心。
基本上给图像一个部分灰色背景,然后将其余部分留白,让图像的外观“浮动”在灰色背景上,并允许我进行简单的 css 更改以更改背景诗句必须重做图像才能改变外观。
这是我尝试过的css:
.borderlist img {
text-align:center;
vertical-align:middle;
background:
linear-gradient
(255,255,255, 0.9),
url('../images/gray.png') no-repeat;
max-width: 100%;
height:auto;
}
And the html:
<a href="http://www.domain.com/bounty.html"><span class="borderlist"><img src="images/bounty.png" alt="BOUNTY" title=" BOUNTY " width="225" height="155"></span><br>BOUNTY </a>
【问题讨论】:
-
你有代码吗?
-
您可以将代码添加到问题中吗?这样,它看起来会更好(具有适当的线端等)。无论如何,答案可能是使用渐变。
-
你的 html 坏了,你能修一下吗?
-
已修复并添加到原始问题中...
-
@Peter 不要忘记将最有帮助的回复标记为答案