display



значения свойства:


  • none
  • block
  • inline
  • inline-block
  • list-item
  • table
  • table-caption
  • table-cell
  • table-column
  • table-column-group
  • table-footer-group
  • table-header-group
  • table-row
  • table-row-group
  • inherit



css/style.css
  • .a {
  •  background-color: #3BA9DE;
  •  display: inline;
  • }
  •  
  • #div1, .b {
  •  height: 50px;
  •  width: 200px;
  •  background-color: #3BA9DE;
  • }
  •  
  • .b {
  •  display: inline-block;
  • }
.a {
 background-color: #3BA9DE;
 display: inline;
}

#div1, .b {
 height: 50px;
 width: 200px;
 background-color: #3BA9DE;
}

.b {
 display: inline-block;
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div>
  •   <div class="a">Hello World!</div>
  •   <div class="a">Hello World!</div>
  •   <div class="a">Hello World!</div>
  •  </div>
  •  <br />
  •  <div>
  •   <div class="b"></div>
  •   <div id="div1"></div>
  •   <div class="b"></div>
  •  </div>
  •  <br />
  •  <div>
  •   <div class="c"></div>
  •   <br />
  •   <div class="c"></div>
  •   <br />
  •   <div class="c"></div>
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.display = "inline-block";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".c").css({ "display": "block", "height": "100px", "width": "300px", "background-color": "#3BA9DE" });
  •  });
  • </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div>
  •   <div class="a">Hello World!</div>
  •   <div class="a">Hello World!</div>
  •   <div class="a">Hello World!</div>
  •  </div>
  •  <br />
  •  <div>
  •   <div class="b"></div>
  •   <div id="div1"></div>
  •   <div class="b"></div>
  •  </div>
  •  <br />
  •  <div>
  •   <div class="c"></div>
  •   <br />
  •   <div class="c"></div>
  •   <br />
  •   <div class="c"></div>
  •  </div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.display = "inline-block";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".c").css({ "display": "block", "height": "100px", "width": "300px", "background-color": "#3BA9DE" });
  •  });
  • </script>
  • </body>
  • </html>