html - Multiple content:url Images -


i trying add multiple images page using css. doing way rather in more 'straight forward' way ensure mobile compatibility (it allows me set percentage widths images allows me them display @ right size on mobile).

i have in stylesheet:

div.image { content:url(http://example.com/example-image1.jpg); width:100% }  div.image2 { content:url(http://example.com/example-image2.jpg); width:25% } 

​ , few more images. , in parts of page:

<div class="image">  </div>  <div class="image2">  </div> 

the problem getting content:url seems working in first instance, picture displays. doesn't seem problem multiple div.s if set 2nd div same content:url image first div, image display twice.

sorry if dumb/noob question...i couldn't find answer.

you forgot bracket :

div.image2{ content:url(http://example.com/example-image2.jpg); width:25% } 

edit: tried bracket , worked. use chrome version 59.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -