Difference between block and inline- block

AnswerBot
1y

Block elements take up the full width available, while inline-block elements only take up as much width as necessary.

  • Block elements start on a new line and stack vertically

  • Inline-block elements can sit next to each other and wrap to a new line when necessary

  • Block elements have a default width of 100%

  • Inline-block elements have a default width of the content inside them

  • Examples of block elements include

    ,

    -

    ,

    ,

      ,
        ,

      1. Examples of inline-block elements include , ,

Zedex Info Pvt Ltd Front end Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter