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 144951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:20:13+00:00 2026-05-11T08:20:13+00:00

I’m trying to put some (vertically-stacked) display:block elements within a display:inline-block element. According to

  • 0

I’m trying to put some (vertically-stacked) display:block elements within a display:inline-block element. According to the CSS specification, the inline-block element should be a containing block, so it can have display:block elements within it and those should not affect the rest of the layout.

However, the display:block elements inside the display:inline-block elements disrupt the rest of the page; so does having nothing at all within the inline-block, or even a basic element like a paragraph; only simple text avoids disruption of the rest of the page (by disruption I mean shifting other divs down, e.g. in this case the left red block moves down a line and has a blank white space above it). I’m using Firefox 3.0.6.

<html><head><style type='text/css'> #left {   display: inline-block;   background: red;   width: 20%;   height: 100%; } #right {   display: inline-block;   background: green;   width: 80%;   height: 100%; } </style></head><body>   <div id='left'>Left</div><div id='right'>Right</div> </body></html> 

The above shows as two panes, left red, right green, as expected. If I change ‘Right’ to

<p>Right</p> 

or remove it entirely, or (as I want to do) replace it with a couple of divs, I get the bad formatting.

Is this a Firefox bug, or am I doing something wrong, or are my expectations incorrect? (FWIW, IE 7 mangles them all equally, as if it doesn’t understand inline-block; doesn’t matter, this is an internal app. and I’m only using Firefox). I may be able to get the layout I want using float/margin, but I’d prefer not to have to do that.

  • 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. 2026-05-11T08:20:14+00:00Added an answer on May 11, 2026 at 8:20 am

    Well display: inline-block can be a bit tricky to get cross-browser. It will require at minimum, a few hacks and, for Firefox 2, potentially an extra element.

    CSS

    .inlineBlock { display: -moz-inline-stack; display: inline-block; zoom: 1; *display: inline; } 

    display: -moz-inline-stack is for Firefox 2. All the immediate children will need to have display: block or otherwise be block level elements. Note if you need your inline-block element to shrink wrap I think you can use display: -moz-inline-box instead.

    zoom: 1 gives hasLayout to the element (for IE 7 and below). Part 1 of the hack needed for IE7 and below compatibilty.

    **display: inline* is a hack second part of the hack needed for IE7 and below compatibility.

    I occasionally need to add overflow: hidden for IE compatibility as well.

    For your specific situation i think what you need is:

    <html><head><style type='text/css'> #left {   display: inline-block;   background: red;   width: 20%;   height: 100%;   vertical-align: top; } #right {   display: inline-block;   background: green;   width: 80%;   height: 100%;   vertical-align: top; } </style></head><body>   <div id='left'>Left</div><div id='right'><p>Right</p><p>Right 2</p></div> </body></html> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Everything you need to try this out: public partial class… May 11, 2026 at 11:44 pm
  • Editorial Team
    Editorial Team added an answer The docs should be on the nVidia developer site, though… May 11, 2026 at 11:44 pm
  • Editorial Team
    Editorial Team added an answer IEnumerable<String> GetLoadedAssemblies() { foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { yield… May 11, 2026 at 11:44 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.