Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:26:51+00:00 2026-05-29T09:26:51+00:00

In CSS, display can have values of inline and inline-block . Can anyone explain

  • 0

In CSS, display can have values of inline and inline-block. Can anyone explain in detail the difference between inline and inline-block?

I searched everywhere, the most detailed explanation tells me inline-block is placed as inline, but behaves like block. But it does not explain what exactly “behave as a block” means. Is it any special feature?

An example would be an even better answer. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:26:51+00:00Added an answer on May 29, 2026 at 9:26 am

    Inline elements:

    1. respect left & right margins and padding, but not top & bottom
    2. cannot have a width and height set
    3. allow other elements to sit to their left and right.
    4. see very important side notes on this here.

    Block elements:

    1. respect all of those
    2. force a line break after the block element
    3. acquires full-width if width not defined

    Inline-block elements:

    1. allow other elements to sit to their left and right
    2. respect top & bottom margins and padding
    3. respect height and width

    From W3Schools:

    • An inline element has no line break before or after it, and it tolerates HTML elements next to it.

    • A block element has some whitespace above and below it and does not tolerate any HTML elements next to it.

    • An inline-block element is placed as an inline element (on the same line as adjacent content), but it behaves as a block element.

    When you visualize this, it looks like this:

    CSS block vs inline vs inline-block

    The image is taken from this page, which also talks some more about this subject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my code is something like this //css li{display:inline-block} //html #li margin and width are
I have html and css as below - .title { display: block; background-color: red;
$(document).ready(function() { $(span.link).mouseover(function(e){ $(this.children).css(display,inline); }); }); I'm not a javascript expert, but I've cobbled
Контакты if(window.location == 'http://my.site.com/contacts/') { $('.menuwelcome').css('display', 'block'); $('.leftlink').find('Контакты').css('font-weight', 'bold'); $('#mcontacts').find('a').html('<b>Контакты</b>').remove(); } How do remove
My Css #container{ display:block; } #container ul{ list-style:none; position:relative; margin:0px; padding:0px; display:block; } #container
I'm having a problem using CSS's display:inline property with the list-style-image: property on <li>
Can anyone explain the weird presentation behavior in the UI screenshot above? As you
I have a css file that looks like: td { display: none; } .showCell
Im using the following JS <a href=# onClick=if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else
<div> <div>test</div> </div> $(div:contains('test')).css('display','none'); I know I am going to kick myself on this.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.