CSS Display



The CSS display property is used to how the elements are going to be placed on the website.it defines display of the different part of web documents.

There are some display values

CSS Inline Elements

These inline elements are not start a new line.

CSS Block-level Elements

These block-level elements are always starts a new line.

  • <div>
  • <h1> to <h6>
  • <header>
  • <p>
  • <form>
  • <section>
  • <footer>

Example

<!DOCTYPE html>
    <html>
    <head>
    <style>
    p {
    color: purple;
    }
    
    p.one{display: none;}
    p.two{display: inline;}
    p.three{display: block;}
    p.four{display: inline-block;}
    p.five{display: run-in;} 
    </style>
    </head>
    <body>
    <h1>The display Property</h1>
    
    <h2>display: none:</h2>
    
    
    <h2>display: inline:</h2>
    
    
    <h2>display: block:</h2>
    
    
    <h2>display: inline-block:</h2>
    
    <h2>display: run-in:</h2>
    
    </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