I'm trying to have the [as shown in picture] , facebook icon and text side by side. I cannot able to get that clearly.
My tried code
CSS
.iconDetails {
margin-left:2%;
float:left;
height:40px;
width:40px;
}
.container2 {
width:100%;
height:auto;
padding:1%;
}
HTML
<div class='container2'>
<div>
<img src='http://ecx.images-amazon.com/images/I/21-leKb-zsL._SL500_AA300_.png' class='iconDetails'>
</div>
<div style='margin-left:60px;'>
<h4>Facebook</h4>
<div style="font-size:.6em">fine location, GPS, coarse location</div>
<div style="float:right;font-size:.6em">0 mins ago</div>
</div>
</div>
My JSFiddle
Entire trick is to use float: left; CSS property on the img element and all the text will automatically wrap around that image. So if you want to align text and image in the same line in HTML like this... In short that is it.
Hold down Shift and use the mouse or touchpad to select the objects that you want to align. Select Shape Format or Picture Format. Select Align. If you don't see Align on the Shape Format tab, select Arrange, and then choose Align.
Choose Insert table: Then, use the toolbar icon again to add another column: You'll have two columns now: Add your content - Use the picture icon for an image and in the other column, add your text.
Your h4 has some crazy margin on it, so remove it
h4 {
margin:0px;
}
http://jsfiddle.net/qMdfC/2/
edit:
http://jsfiddle.net/qMdfC/6/
for the 0 minutes text, added a float left to the first div, but personally i'd just combine them, although you may have reasons not to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With