Loading Please Wait...

Logo Lynxsia IT Solutions

CSS Block And Inline

CSS Display Block And Inline

The CSS block, inline, and inline-block properties sets whether an element is treated as a block or inline element.

CSS Display Inline

The inline element does not break the flow and only takes as much space as necessary.

					 
        
          span{
            display: inline;
            width: 100px;   /* ignored */
            height: 100px;  /* ignored */
            margin: 10px;  /* only horizontally (vertically overlap) */
            width: 10px;   /* only horizontally (vertically overlap) */
          }
        
      
A inline element will not accept width and height.
A inline element will accept padding and margin. But it will push other element horizontally away, not vertically.
CSS Display Inline Block

The inline-block element is very similar to inline in that it will set inline with the natural flow of text. The difference is that you are able to set a width and height.

					 
        
          span{
            display: inline-block;
            width: 100px;   /* applied */
            height: 100px;  /* applied */
            margin: 10px;  /* applied */
            width: 10px;   /* applied */
          }
        
      
CSS Display Block

A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can).

					 
        
          span{
            display: block;
          }
        
      
display block, inline, inline-block example

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved