css - How to align these DIVs side by side (fiddle inside)? -


i've managed align side side div containing image, , div containing text, side side, applying float:left image div.

but when include these 2 divs in parent div, , duplicate parent , try align parents side side applying float:left first parent, doesn't work.

here's code:

<div style="width:350px;min-height: 200px; float:left;">   <div style="float:left;"><img src="image.jpg" width=120px height=120px style="border: 1px solid black;padding:1px;"></div>   <div style="font-size:15pt;color:red;letter-spacing:-.04em;padding-top:2px;padding-left:135px;">title</div>   <div style="font-size:11pt;color:black;letter-spacing:-.02em;margin-top:4px;padding-left:135px;">text text text text text text text text text text text text text text text text.</div> </div>  <div style="width:350px;min-height: 200px;">   <div style="float:left;"><img src="image.jpg" width=120px height=120px style="border: 1px solid black;padding:1px;"></div>   <div style="font-size:15pt;color:red;letter-spacing:-.04em;padding-top:2px;padding-left:135px;">title</div>   <div style="font-size:11pt;color:black;letter-spacing:-.02em;margin-top:4px;padding-left:135px;">text text text text text text text text text text text text text text text text.</div> </div> 

and fiddle.

i wonder whether rest of code best practice, such padding-left:135px - better use relative padding image, rather parent div? if so, what's easiest way change that?

you have float:left outside of style attribute, try moving inside speech marks , applying float: left both parent divs.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -