welcome to tutorialfamily

css display

css display property used for controling layout of web page.

Block element and inline element.


display property

  • block level element – div, h1 to h6, header, footer, p, section, form
  • inline element – span, img, a

inline property


						        
<!DOCTYPE html>
<html>
<head>
<style>
li {
  display: inline;
  padding: 10px;
}
</style>
</head>
<body>
<div class="menu">
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Service</a></li>
  </ul>
</div>
</body>
</html>



Run

block level


						        
<!DOCTYPE html>
<html>
<head>
<style>
div {
  display: block;
  font-size: 14px;
}
p {
  display: block;
  font-size: 14px;
}
</style>
</head>
<body>
<div>This is my car</div>
  <p>
    This is my car
  </p>
</div>
</body>
</html>



Run

Our Content