Using display:inline-block
#element1 {display:inline-block;margin-right:10px;}
#element2 {display:inline-block;}
More Related Contents:
- CSS margin terror; Margin adds space outside parent element [duplicate]
- Why does this CSS margin-top style not work?
- How wide is the default “ margin?
- How do you keep parents of floated elements from collapsing? [duplicate]
- How to align 3 divs (left/center/right) inside another div?
- Why is there an unexplainable gap between these inline-block div elements? [duplicate]
- Why doesn’t the height of a container element increase if it contains floated elements?
- How to remove margin space around body or clear default css styles
- float:left; vs display:inline; vs display:inline-block; vs display:table-cell;
- How can I wrap text around a bottom-right div?
- How do I get a div to float to the bottom of its container?
- Removing body margin in CSS
- IE9 Float with Overflow:Hidden and Table Width 100% Not Displaying Properly
- CSS margin adds space outside parent element [duplicate]
- Why can’t I center with margin: 0 auto?
- Margin top in inline element
- CSS Float: Floating an image to the left of the text
- Why would margin not be contained by parent element?
- Why doesn’t “margin: auto” center an element vertically?
- `margin:auto;` doesn’t work on inline-block elements
- CSS Float Logic
- Is there a disadvantage of using `display:table-cell`on divs?
- Why do s clear floats?
- CSS Margin: 0 is not setting to 0
- CSS Cell Margin
- Is there any way to add padding to select options via CSS?
- Floating Div Over An Image
- Align a div to center
- Prevent floated divs from wrapping to new line
- Table with table-layout: fixed; and how to make one column wider