CSS inline-block



The inline-block and CSS display are same.

Lets compare display :inline;,there are a important difference is that

Lets compare display :inline;,there are a important difference is that display: inline-blockto set element width and height.

Example

<!DOCTYPE html>
<html>
<head>
  <style>
    div {
  display: inline-block;
  height: 100px;
  width: 100px;
  background: yellow;
  color: black;
  padding: 6px;
  margin: 3px;
}
  </style>
</head>

<body>

<div>one</div>
<div>two</div>
<div>three</div>

</body>

</html>


Click on the "Run This Code" button to see how it works.





CSS

Welcome CSS Syntax CSS Selectors CSS ADD css CSS Borders CSS Backgrounds CSS Colors CSS Padding CSS Margin CSS Fonts CSS Text CSS Outline CSS Box-Model CSS Height&Width CSS Icons CSS Links CSS Lists CSS Display CSS Tables CSS Position CSS Overflow CSS Align CSS Float CSS Inline-block CSS Opacity CSS Image-Gallery CSS Navigation Bar CSS Dropdowns CSS Cursors CSS Forms CSS Pseudo-classes CSS Pseudo-elements

CSS3 FEATURES

CSS Gradients CSS shadows CSS 2D Transforms CSS 3D Transforms CSS Animations CSS Media Queries CSS Flexbox CSS important CSS Units