I wanted to display two <div> elements that have width and height side by side. I applied inline-block to <div> s, but the position of the left element is weird:

HTML:
<body> <div id="myDivTag">content</div> <div id="map-canvas">for google map API</div> </body>
CSS
#myDivTag, #map-canvas { display: inline-block; height: 95%; width: 49%; z-index: 0; }
The only difference between the two elements is the overflow: hidden option. When I apply overflow: hidden to #myDivTag , it works fine, but I don't know why. I think this has nothing to do with the overflow property. But my thought is clearly wrong. Why?
source share