It is because display:inline-block
takes into account white-space in the html. If you remove the white-space between the div
‘s it works as expected. Live Example: http://jsfiddle.net/XCDsu/4/
<div id="col1">content</div><div id="col2">content</div>
More Related Contents:
- Trouble with image
- Which way to implement this picture in HTML CSS code and bootstrap
- Can I have an onclick effect in CSS?
- Fill the remaining height or width in a flex container
- Why aren’t my absolutely/fixed-positioned elements located where I expect?
- float:left; vs display:inline; vs display:inline-block; vs display:table-cell;
- How to remove the arrow from a select element in Firefox
- Colspan/Rowspan for elements whose display is set to table-cell
- css background color with floating elements
- Transform: translate(-50%, -50%)
- How to create a curve between two gradient using CSS?
- How can I fill a div with an image while keeping it proportional?
- Line break (like ) using only css
- How to create a transparent triangle with border using CSS?
- Turn off Chrome/Safari spell checking by HTML/css [duplicate]
- How to get a background image to print using css?
- How to set an image’s width and height without stretching it?
- Make flex items overlap
- HTML class attribute with spaces, it is a W3C valid class?
- Aligning elements left and center with flexbox
- How to set placeholder value using CSS?
- Changing the highlight color when selecting text in an HTML text input
- How to run the CSS3 animation to the end if the selector is not matching anymore?
- How to add button inside an input [closed]
- Unwanted border-radius corners around images in Brave/Chrome browser
- Progress Bar with HTML and CSS
- scrollable?
- Why aren’t my bootstrap 4 columns the same height?
- How to get horizontal scroll bar in select box in IE?
- Table with table-layout: fixed; and how to make one column wider