HTML is
<div class="jfmfs-friend-container">
<div class="jfmfs-friend ">
<input class="friend-checkbox" type="checkbox">
<img src="/picture">
<div class="friend-name">Test User</div>
</div>
</div>
Here I am able to achieve all three elements checkbox, img and friend-name div in a single line. I am looking for following:
- checkbox and friend-name in verticall middle to the img.
- Word wrap in the friend-name div
- All elements with equal distance (atleast 5px) to each other. Right now all 3 are adjacent to each other with no space
Here is my CSS. I am giving css code for the parent div incase of any display:block property:
.jfmfs-friend div {
color:#111111;
font-size:11px;
overflow:hidden;
display:inline-block;
}
div.friend-name {
margin-left: 10px;
vertical-align: middle;
word-wrap: break-word;
}
.friend-checkbox {
position: relative;
vertical-align:middle;
display: inline-block;
}
#jfmfs-friend-container {
overflow:scroll;
overflow-x: hidden;
-ms-overflow-x: hidden;
width:100%;
height:400px;
font-family: 'lucida grande', tahoma, verdana, arial, sans-serif;
color: #333;
font-size: 12px;
}
Demo: http://jsfiddle.net/55twK/
vertical-align:middleto all three elements, now you miss img.