Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anonymous white space between two divs

Tags:

html

css

Here is the Fiddle,

I have two divs one is for header and the other is for the main body. Inside the div which is for header, i'm having another div and that div was floated left. Due to that floating, a white space has occurred between those two divs (between the div for header and div for main body).

[Note: Please refer #DivLogo in the css section of the fiddle]

My question is, why this kind of problem is raising due to floating.?

like image 378
Rajaprabhu Aravindasamy Avatar asked Dec 04 '22 10:12

Rajaprabhu Aravindasamy


1 Answers

It's an artifact of having your #DivHeader be inline-block. Change it to display: block and set overflow: hidden; to contain the floats. See http://jsfiddle.net/jhcUb/

like image 53
CodeMoose Avatar answered Dec 06 '22 23:12

CodeMoose