Can someone help me to find my Problem ?
I have a <img />
and will give him a background-image within a <a>
tag.
Here is my example:
<img border="0" style="display:block; width:20px; height:20px; background-color:red; padding:9px; background:url(\'./images/system/button/close/close.png)\' no-repeat" />
Background-Color didn't work to.. :-( My Example is a JavaScript String, thats the reason why I'm escaping the URL
Thank's for help :-)
HTML <img> Tag When you want to be indexed by the search engine. Google doesn't index background images automatically. Browsers don't provide any information on background images to assistive technology. But using the <img> tag with the alt and title attributes will help to be recognised by screen readers.
The background-image property sets one or more background images for an element. By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.
Use IMG if you rely on browser scaling to render an image in proportion to text size. Use IMG for multiple overlay images in IE6. Use IMG with a z-index in order to stretch a background image to fill its entire window.
Say you want to put an image or two on a webpage. One way is to use the background-image CSS property. This property applies one or more background images to an element, like a <div> , as the documentation explains.
you dont even need the quote marks.
background:url(./images/system/button/close/close.png)
use a div if you can
<div style="height:20px; width:20px; padding:9px; background:url(./images/system/button/close/close.png) no-repeat red"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With