当前位置:网站首页>Block level elements & inline elements

Block level elements & inline elements

2022-06-27 06:09:00 Whistle candy youri

Block-level elements :

  • div
  • p
  • h1~h6
  • ul
  • li

characteristic :

  1. Line break
  2. Width fills the width of the parent element
  3. You can set height, width, margin, padding

Height , The width is full of parent elements

      .box1 {
    
        background-color: coral;
        height: 100px;
      }
      .box2 {
    
        background-color: aqua;
        height: 100px;
      }

 Insert picture description here

Inline elements :

  • span
  • a

characteristic :

  1. Don't wrap
  2. Width and height package content
  3. Only left and right can be set margin, padding

Inline block element :

  • img
  • input

characteristic :

  1. Don't wrap
  2. Width and height package content
  3. You can set height, width etc.
原网站

版权声明
本文为[Whistle candy youri]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206270545518323.html