【发布时间】:2015-11-08 06:25:24
【问题描述】:
我有更多页面的 web 应用程序,我无法更改所有页面,但我可以更改 css 代码。
我有一个带有 css 类的“缩略图”标签的 img 来显示图像。
我想用 css 在图像上显示一个框。
.thumbnail {position:relative;width:128px;height:128px;}
.thumbnail:after {position:absolute;width:20px;height:128px;top:0px;right:0px;background-color:#ff0;content:" ";z-index:100;}
<img class="thumbnail" src="http://mrizvandi.com/Media/Image/QRCode/ContactInfo.jpg" />
当我在 css 中使用 :after 时,我看不到任何效果!
有没有什么解决方案可以在没有附加标签的情况下显示覆盖框而只使用css?
提前致谢。
【问题讨论】:
标签: html css overlay pseudo-element