As you can see, I have a main div (id="main_div") which contains 2 divs id="logo" div which contain a link to a picture id = "intro" which contains only text
http://jsfiddle.net/omerbach/y7n2b/
<div id="main_div">
<div id="logo" class="headers">
<a href="http://www.hawkaviation.com" target="_blank">
<img src="http://www.badcomp.com/wp-content/uploads/2011/03/recommend-hawk.jpg" alt="Hawk Aviation" />
</a>
</div>
<div id = "intro" class="headers">
PLACE YOUR ORDER NOW !!!
</div>
</div>
inline-block
http://jsfiddle.net/omerbach/NneB6/
body {
background : white;
}
#main_div {
background:gray;
border : solid 3px red;
}
.headers {
border : solid 1px black;
display : inline-block;
}
I have a couple of questions : When using inline, the picture is not in its surrounding div (you can see the black border) When using inline-block, the picture is in its surrounding div (you can see the black border)
I thought that the purpose of inline-block is a way to make elements inline, but preserving their block capabilities such as setting width and height, top and bottom margins and paddings etc.. I do not have any of those specified so i don't understand why inline-block should be used in my case.
Also regarding both examples, why does the seconds inner is aligned to the bottom of the first one?is that the default behavior ?
Thanks