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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:49:08+00:00 2026-05-23T12:49:08+00:00

While many other questions address the vertical alignment of elements, none seem to cover

  • 0

While many other questions address the vertical alignment of elements, none seem to cover my particular situation.

I am trying to effect the following layout, whereby inline elements of unequal height are bottom justified with respect to a container:

+-------------------+
|     +-------+     |
|     |       |     |
|+---+|   B   |+---+|
|| A ||       || C ||
|+---++-------++---+|
+-------------------+

An example can be seen here. Three elements are shown, but assume more of various sizes, though all in a single line.

The example is purposefully incomplete for the sake of illustration. At least one element, say the middle element B, must have a content height and width that is not fixed but is instead determined by (padded) text or some other content. The effect can be seen here.

The bottom of each of the flanking elements A and C aligns with the baseline of the text of B. This raises A and C above the bottom of the container, which is the first problem. The second problem is that the elements must be horizontally flush with respect to each other. (IIRC, the horizontal spacing between adjacent inline elements is unspecified and therefore browser dependent, though at the moment I can’t find the appropriate passage in the CSS spec.)

I can fix the second problem by floating each element. The effect can be seen here.

Now the flanking elements A and C are top justified, as expected. The various solutions that I have found for bottom justifying a floated element make assumptions that are violated by my layout requirements (such as a contained element of non-determinate width).

I did think of one solution that just feels wrong, however: double flipping via transforms. The container and each contained element are vertically flipped by a scale transform. Flipping the container justifies the floated elements to its bottom, and flipping each contained element re-orients the contained element. The effect can be seen here.

This works, but it makes a little part of me die inside. Is there a better solution for this?

  • 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-23T12:49:09+00:00Added an answer on May 23, 2026 at 12:49 pm

    Starting from your second example..

    Add vertical-align: bottom to div, see: http://jsfiddle.net/awkjj/4/

    The simplest fix for the gaps is to remove the whitespace in the HTML: http://jsfiddle.net/awkjj/7/

    If that’s distasteful, there are other ways to remove the gaps.

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

Sidebar

Related Questions

While many ask questions about where to find good books or tutorials, I'd like
this question is very similar to many other questions posted on stack overflow,I have
First off, I'm aware that there are many questions related to this, but none
ok I am well aware there are many other questions about this, but I
I looked at many other questions, but I can't find my own answer in
As pointed out in many other questions, turning display_errors to Off in php.ini makes
NOTE: There are other questions related to this on SO, but none of them
I've examined various questions about taglibs and implicit objects here. While many of the
See VSS or SVN for a .Net Project? , among many other similar questions.
Many other questions is about this around StackOverflow. I haven't found any where the

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.