Home  >  Q&A  >  body text

css - Questions about width and height in HTML (the title of this question is hard to come up with)

欧阳克欧阳克2677 days ago865

reply all(4)I'll reply

  • 学习ing

    学习ing2017-06-21 10:14:42

    1. Just a normal block element
    2. Set overflow

    reply
    0
  • typecho

    typecho2017-06-21 10:14:42

    The default value of width and height is auto; block-level elements will inherit the width of the parent element, and the height is related to its own content;

    reply
    0
  • 为情所困

    为情所困2017-06-21 10:14:42

    .box1 has set height and width, but .box1 cannot hold so much text, so it will be exceeded. Because the default value of overflow is visible, it will be displayed normally even if it is exceeded. If you set overflow:hidden; or overflow:auto; or other value, the effect will be different.
    .box2 has a width set but no height. The height is determined based on the amount of text.
    .box3 sets the height, and the width is inherited from the parent element, which is 100%; this is the same as .box1, except that the width is different

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-21 10:14:42

    "Waiting for You" gave a very detailed answer. Properties are inherited. Please read more about W3C

    reply
    0
  • Cancelreply