Using inline-block vs inline, both don't seem to work to what I'm expecting

inline vs inline-block
inline-block bootstrap
difference between inline and block
block inline and inline-block elements
span inline-block
li inline-block
display: inline
button display: inline-block

*, html, body { padding: 0; margin: 0; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; background: #ffe6eb; color: #4E2B99;}
.container { margin: 0px auto; max-width: 1000px; text-align: center; }
.header img { width: 5em; }

/* item */
.item { max-width: 500px; display: inline-block; }
.item .byf { font-style: italic; }
.item .byf-avatar { max-width: 1em; border-radius: 1em; }
.item .content { margin-top: 10px; min-height: 200px; background-color: white; border-radius: 5px; }
<html>
  <head>
    <title>Friends of Friends - Peach</title>
  </head>
  <body>
    <div id="container" class="container">
      <!-- Begin Header -->
      <div id="header" class="header">
        <img src="http://peach.cool/images/icon-peach-header-big@2x.png" alt="logo" />
      </div>
      <!-- End Header-->

      <!-- Begin Content -->
      <div id="content" class="content">
        <div id="items" class="items">

          <!-- Begin Item -->
          <div id="item-1" class="item">
            <span class="byf">Because you follow <img src="https://scontent.fcmh1-1.fna.fbcdn.net/v/t1.0-9/38600406_695730037430614_8379042433521942528_o.jpg?_nc_cat=103&oh=e3b71b3b819c1bd035c98057e5b7a69a&oe=5C4FEC80" alt="avatar-1" class="byf-avatar" /> <strong>Name</strong>... </span>
            <div id="content" class="content">
              <div class="content-list">
                <div class="content-list-item">
                  <span class="cli-name">Name</span> @<span class="cli-handle"></span>
                </div>
              </div>
            </div>
          </div>
          <!-- End Item -->

          <!-- Begin Item -->
          <div id="item-1" class="item">
            <span class="byf">Because you follow <img src="image" alt="avatar-1" class="byf-avatar" /> <strong>Name</strong>... </span>
            <div id="content" class="content">
              <div class="content-list">
                <div class="content-list-item">
                  <span class="cli-name">Name</span> @<span class="cli-handle"></span>
                </div>
              </div>
            </div>
          </div>
          <!-- End Item -->

        </div>
      </div>
      <!-- End Content -->
    </div>
  </body>
</html>

The problem is with the max-width, not the display. Both inline-block and inline were doing what they were supposed to do. On inline elements, widths applied in CSS don't apply. On inline-block, they do.

However, CSS max-width only takes effect if the content is wider than the max-width. Currently, your content is not more than 500px wide. You need to set a width property for max-width to take effect, like this.

.item{
    max-width:500px;
    width: 100%;
    display:inline-block;
 }

However, CSS has two different types of boxes — block and inline. Inline elements don't start on a new line, they appear on the same line as the One common use for using inline-block is for creating navigation links  Let’s try using inline-block here. <!DOCTYPE html> <html> <head> <title>inline</title> </head> <style> a { display:inline-block; border:2px red solid; width:400px; } </style> <body> <a href="">Link 1 </a> <a href="">Link 2 </a> <a href="">Link 3 </a> <a href="">Link 4 </a> <a href="">Link 5</a> </body> </html>.

display:inline-block; will take height, width and will display next to each other while display:inline doesn't take height and width but will display to each other. for you max-width:500px its working because you're content is just 200px wide, if you widen your contents you will get a scrolling effect or your content will go outside the container if its more than 500px.

It actually still exists on the HTML structure, but with display: none an element <​img> or <a Duration: 5:51 Posted: Dec 7, 2018 Inline vs Inline-Block Display in CSS display: inline-block brought a new way to create side by side boxes that collapse and wrap properly depending on the available space in the containing element. It makes layouts that were previously accomplished with floats easier to create.

In an ideal scenrio, inline container cannot hold block level elements. In your case class="item" you are trying to have inline which is holding child of class="content" which is block element and as expected you inline container width will be of the block child element.

This has been possible for a long time using float , but now with inline-block it's even easier. inline-block elements are like inline elements but they Let's look at examples of both approaches. I'm using clear so I don't float next to the above boxes. .box2 { display: inline-block; width: 200px; height: 100px; margin: 1em; }​. You can’t do this with floats. This has been the main reason I’ve been using inline-blocks more, which I’ll get to in a bit. Whitespace — inline-blocks pick up html whitespace. If you have several inline-block elements each on a new line in your html they’ll display with a horizontal space between them.

Both inline-block and inline-table have an inline outer display role. The element generates a block container box, and lays out its contents using flow layout. Also, with display: inline-block, the top and bottom margins/paddings are respected, but with display: inline they are not. Compared to display: block, the major difference is that display: inline-block does not add a line-break after the element, so the element can sit next to other elements.

Compared to display: inline , the major difference is that display: inline-block allows to set a width and height on the element. Also, with display: inline-block , the  An inline element can't have width and height property set whereas a block and an inline-block element can have. An inline element can not have top or bottom margin that can be set for an inline-block element and block element. Both inline and inline-block elements allow keeping elements beside other but block elements are placed one on another.

But let's start off with the essential inline . This one displays the element inline or on the same line. In other words, inline elements do NOT start on a new line and​  IE6 and IE7 work perfectly fine with inline-block, but you have to use both display: inline; WITH zoom: 1; The easiest least hackish way to do this is use a conditional comment for IE7 and under and copy all your inline-elements into a style tag and give them the necessary properties. I have an example for this here, just look at the HTML: jsFiddle