How to set image alt and title text using CSS background image

Please help me to setup image alt and title text using CSS background image

Ex:

<style type=“text/css”>
Content { background: url(http://img.jpg) no-repeat left top; }
</style>

<div id=“content”>a<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
a
</div>

Those are attributes of the <img> tag, you can’t set them on a background image.

Any image that needs a text equivalent is content and should be an <img> element. A background image is purely decorative and mustn’t convey any important information.

You can set the title attribute of the <div>.

thanks for that note :slight_smile: