RE: What is the CSS ‘display’ property and can you give a few examples of its use?

    What is the CSS ‘display’ property and can you give a few examples of its use?

    Ahana Roy Senior Developer Asked on June 5, 2018 in CSS.
    Add Comment
    1 Answers

       

      <html>
      <head>
      <style>
      p {color: blue;}
      p.demo1 {display: none;}
      p.demo2 {display: inline;}
      p.demo3 {display: block;}
      p.demo4 {display: inline-block;}
      </style>
      </head>
      <body>
      <h1>Display Property</h1>
      <h2>display: none:</h2>
      <div>
      Lorem <p class="demo1">ipsum dolor</p> sit amet
      </div>
      <h2>display: inline:</h2>
      <div>
      Lorem <p class="demo2">ipsum dolor</p> sit amet
      </div>
      <h2>display: block:</h2>
      <div>
      Lorem <p class="demo2">ipsum dolor</p> sit amet
      </div>
      <h2>display: inline-block:</h2>
      <div>
      Lorem <p class="demo2">ipsum dolor</p> sit amet
      </div>
      </body>
      </html>
      

       

      Default Answered on November 25, 2018.
      Add Comment

      Your Answer

      By posting your answer, you agree to the privacy policy and terms of service.