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

  • Home
  • SEARCH
  • 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 3802876
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:16:34+00:00 2026-05-19T14:16:34+00:00

Please consider the following HTML code: <html xmlns=http://www.w3.org/1999/xhtml xml:lang=en lang=en> <head> <meta http-equiv=Content-Type content=text/html;charset=utf-8>

  • 0

Please consider the following HTML code:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <title>test</title>
    <style>
        .section {
            display: inline-block;
            border: 1px dashed blue;
        }
        .outer {
            border: 1px dashed red;
            margin: 10px;
        }
    </style>
</head>
<body>
    <div style="height: 500px; width: 200px;" class="section">a
        <div style="height: 100px;" class="outer">1A<br />1B</div>
    </div>
    <div style="height: 500px; width: 200px;" class="section">b
        <div style="height: 200px;" class="outer">2</div>
        <div style="height: 200px;" class="outer">3<br />4<br />5</div>
    </div>
</body>
</html>

Since both divs with class “.section” are the same height, and are inline-blocks, I would expect them to be both vertically aligned. However, the first of these divs is pushed down, so that the text “1B” is aligned with the text line “5” from the other section. Adding or removing lines in either div has a direct impact on the vertical position of my first section.

I don’t see the logic of this, and I can’t find the answer in the official CSS3 documentation either. Yet, it does not seem to be a bug, as it’s identical in Chrome 8, Safari 5, Opera 9.5 and Firefox 4 beta … didn’t try IE, since it’s not a reference anyway.

I’m looking for a rational explanation for this phenomenon. Of course there are several workarounds (e.g. changing inline-block to inline-table fixes the problem, or I could use normal floating blocks, etc …). However I’m trying to comprehend this behaviour.

Hopefully there is someone wiser than myself out there who can explain this.

Live example here.

  • 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-19T14:16:34+00:00Added an answer on May 19, 2026 at 2:16 pm

    The default value for vertical-align in CSS is baseline. This means that the baseline of the last text in the first section (“1B”) is lined up with the baseline of the last text in the second section (“5”) – and also with the baseline of any surrounding text if you had any.

    If you add an explicit vertical-align: bottom; to your .section CSS then that will use the bottom of the inline-block as the alignment guide, giving the result you want.

    See http://www.brunildo.org/test/inline-block.html for a demonstration of how vertical-align applies to inline blocks

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

Sidebar

Related Questions

Consider the following example code: http://code.google.com/apis/maps/documentation/javascript/examples/streetview-simple.html I can do scrollwheel: false on a mapOptions
Please consider the following fork() / SIGCHLD pseudo-code. // main program excerpt for (;;)
Please consider the following HTML: <td> Some Text <table>.....</table> </td> I need to manipulate
Please consider following code: 1. uint16 a = 0x0001; if(a < 0x0002) { //
Please consider the following HTML: <input type='text' id='name'/> <option id='option'> <select value='1'>hi</select> <select value='2'>bye</select>
Please consider the following code. enum type {CONS, ATOM, FUNC, LAMBDA}; typedef struct{ enum
Please consider the following: DECLARE @xml XML SET @xml = '<Capture> <Data><DataType>Card Number</DataType><Value>1234567898765</Value></Data> <Data><DataType>Expiry
Please, consider the following (I'm sorry for the amount of code; but this is
Please consider the following: <td style=width: 500px;> <div style=width: 400px;>SomeContent</div> </td> For some reason,
Please consider the following scenario: map(T,S*) & GetMap(); //Forward decleration map(T, S*) T2pS =

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.