Try the vertical-align
CSS property.
#box1 {
width: 50px;
height: 50px;
background: #999;
display: inline-block;
vertical-align: top; /* here */
}
Apply it to #box3
too.
More Related Contents:
- How would I achieve a shadow that won’t show through transparent text?
- Fill in text in HTML5
- Change text-color on div :hover [closed]
- CSS customized scroll bar in div
- iPad Safari scrolling causes HTML elements to disappear and reappear with a delay
- Does height and width not apply to span?
- Is there a way to apply a CSS style on HTML5 datalist options?
- Show Child Div within Hidden Parent Div
- HTML 5 strange img always adds 3px margin at bottom [duplicate]
- Failed to decode downloaded font
- Actual table Vs. Div table
- How can I ensure that text is inside rounded div?
- Which HTML5 reset CSS do you use and why? [closed]
- What is the current state of the “scoped” attribute for the style element in HTML5?
- Proper way to apply CSS to HTML5 custom elements
- Div height 100% and expands to fit content [duplicate]
- Add a text suffix to
- html5 vertical spacing issue with
- Adjacent divs with angled borders? [duplicate]
- How to position a div in the middle of the screen when the page is bigger than the screen
- How to write a caption under an image?
- How do I line up 3 divs on the same row?
- How to set height property for SPAN
- CSS: How to align vertically a “label” and “input” inside a “div”?
- Div side by side without float
- Best replacement for font tag in html
- Full background image with fade effect
- Can I replace the expand icon (▶) of the element?
- How to add bordered triangle over a div tag
- Trouble (vertically) Centering Text in another DIV with relative % sizing