开发者

Show image with a background colour - CSS

I think all of you are familiar with this, images on facebook comes with a default background

How can i achieve same type of background color for images [without using any div just for开发者_如何转开发 the background]

As you can see my codes also creates background color but they are not rectangle in size :(

This is the preview

Show image with a background colour - CSS


Your question's not very clear, but here's how to use a background colour and image on the same element:

#element-id { background: #999 url(path/to/image.gif); }

or, in longhand

#element-id { background-color: #999; background-image: url(path/to/image.gif); }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜