CSS: background color for <li> troubles (with floated <img>) -


when <li>'s have background color , floating against image floated left.

i background color of li left justified paragraph, not left edge of page. bulletproof ways of doing this? wish simple adding display: inline; <ul>. large left margin wider image not option, images varying widths.

thanks input. 1 has been ongoing struggle in designs, , figure out perfect "fix" this.

fiddle here: http://jsfiddle.net/3khky/3/

/// css ---->

li { background-color: red; margin-left: 10px; color: white;} img { float: left; margin-right: 10px; } 

/// html --->

<p>   <img src="http://i.ehow.com/images/a04/v1/cb/started-new-kitten-200x200.jpg" /> </p> <h2>title</h2> <ul>   <li>lorem ipsum</li>   <li>lorem ipsum</li>   <li>lorem ipsum</li> </ul> <p>more content here.</p> 

did mean that?


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -