html - How do I fix the span to have img as background? -

now fine when set picture background background: url(http://simplisafe.com/files/images/icons/check_mark.png) , got desired output. when user sets font-size else, check mark picture remains same size (the font size setting indirectly changes size of spans , divs too). basically want picture scalable , in background behind number.
i tried background-size, doesn't work.
<html> <head><style type="text/css"> html {overflow-y:hidden;} body {overflow-y:auto;} input { margin: 3px 0; vertical-align: middle; } .box { border: 1px solid #aeaeae; padding: 3px; width: 6em; text-align: left; text-indent:.3em; } .innerbox { width: 4em; text-align: left;} #page-background {position: absolute; z-index:-1;} #content {position: relative;} </style> </head> <body> <span class="box" id="1"><nobr> <span id="page-background"><img src="http://simplisafe.com/files/images/icons/check_mark.png" />0 <span class="innerbox" id="content"> <div id="p_0" align="left" > <input style="width:100%; border:1px solid #b4b4b4; font-size:12px" type="text" id="1" /> </div> </span> </span> </nobr></span> <body> </html> i added both #page-background , #content make checkmark img background of span messes span. tested #page-background , #content on 2 overlapping spans , works fine, when tried on add existing code, position: absolute messes span (see picture).
how can fix or there way this?
your html wrong...
since seems can't change html (sic), can use this.
edit: or this (using position: absolute) you'd better change html anyway, b/c must use padding in case , i'm not sure :
- it'll same effect on every browser (tested on chrome)
- changing size (by script don't give... can't test) won't stretch it.
anyway, if can change it, it'll lighten things this
Comments
Post a Comment