<div>Elements with display:inline-block elements are like display:inline elements, 
   but they can have a width and height. Notice how the height will push the next inline element down. Try changing the 3 to a 2 on the next line. Can be unexpected. It will then continue tp push any other inline elements that bump into it. h + w wont apply... <span class="inline">display: inline - line break oddity</span> Integer nec odio. Praesent libero. Sed cursus ante dapibus diam.  Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. <span class="inline-h-w">display:inline-block no line break oddity issues keeps wrapping inside the element, pushing everything around </span> tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. <span class="inline-p">display:inline with padding </span> Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nun.</div>
body { 
  font: normal 1.2em/2em Arial; 
  background-color: #444;
  color: #ccc;
}
div  {
   background-color: #333;
   padding: 2em;
   position: absolute;
   top:50%;
   left:50%;
   margin-right: -50%;
   transform: translate(-50%, -50%);
   width: 33em;
}
/* Elements with display:inline-block elements are like display:inline elements, 
   but they can have a width and height. */
.inline {
  display: inline;
  background-color: #222;
  /* Notice how the height will push the next inline element down.
  Try changing the 3 to a 2 on the next line. Can be unexpected. 
  It will then continue tp push any other inline elements that 
  bump into it. */
  padding: 2em 3em;
/* h + w wont apply */
  opacity: .7;
}
.inline-h-w {
  display: inline-block;
  background-color: #111;
  /* inline-block with no h + w will act just like inline */
 // height: 4em;
  //width: 15em;
  text-align: center;
}
.inline-p {
  display: inline;
  background-color: #666;
/* padding does two notable things here, it pushes the inline 
  text to the border of it's width and it lines breaks and brings it's entire 
  surrounding box with it. */
  padding: 2em 4em;
  opacity: .7;
}
View Compiled
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.