css3 - CSS: background-image inside another image (or canvas) -


is there way set background-image fit inside image? example explains all:

enter image description here

this should it, assuming png has transparent section. if can make images correct size, first option work. second option ensures 1 aligns left , second aligns right. depending on requirements, may need add padding second image , possibly scale correct size.

comment {background-image: url("bubble.png"), url("people.png");} 

or more control

 comment {        background-image: url("bubble.png") left top no-repeat, url("people.png") right top no-repeat;     } 

and offset , pixel size inserted image:

 comment {        background-image: url("bubble.png") left top no-repeat, url("people.png") left 30px top 20px / 300px 200px no-repeat ;     } 

for more details see css3.com


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -