我一直在使用:之前或之后:CSS技巧(在本文中解释:http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-multiple-borders-with-simple-css/)实现多个边框和背景。它在div
元素上效果很好,但我注意到它根本不适用于图像。:之前和之后:图像上的多边框/背景技巧?
这里是我的代码:
.author img {
position: absolute;
left: 10px;
background-color: #fff;
padding: 3px;
border: 1px solid #d0d0d0;
width: 48px;
}
.author img:before {
content: '';
display: block;
width: 80px;
height: 16px;
position: absolute;
top: -17px; left: 0;
background: red;
}
有没有用这一招上的图像的方式或将我包裹我的图片附加DIV?
不确定,但尝试给图像'显示:块'以及 – 2010-08-28 11:11:13
不,没有改变任何东西。 – Justine 2010-08-28 17:15:04