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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:49:58+00:00 2026-06-06T06:49:58+00:00

In CSS, can I line up heights of inline-blocks? I thought by setting margins

  • 0

In CSS, can I line up heights of inline-blocks?

I thought by setting margins to 0 and height to auto, that the block would expand to fit the available space, but it still tightly wraps around the block.

.myclass {
    display: inline-block;
    margin: 0em;
    padding: 1em;
    height: auto;
    border: solid;
}

http://jsfiddle.net/6NQDw/

I would like both boxes to be the same height, but want the div width/heights to be determined by their content, not specifying a width/height in pixels.

Is there some kind of padding/margin/alignment CSS or something like that that I can use?

  • 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-06-06T06:50:00+00:00Added an answer on June 6, 2026 at 6:50 am

    You could use display:table-cell; if you require a pure CSS solution but do take note that it won’t work in IE7 (I guess IE6 is by now completely forgotten).

    .myclass {
        display: table-cell;
        margin: 0em;
        padding: 1em;
        height: auto;
        border: solid;
    }
    

    Cross browser support for display:table-cell

    Your best bet for achieving what you need is JavaScript however explicitly setting width of containers with dynamic content is almost always not the right way to solve the issue.

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

Sidebar

Related Questions

how we can create a diagonal heading line with pure CSS like mentioned below
We can write CSS as the following types: Inline CSS Embedded CSS External CSS
Where do I find a good CSS editor that can help me use all
I'm trying to find a CSS selector that can help me distinguish between the
How does the CSS Block Formatting Context work? CSS2.1 specifications says that in a
OK! I just started HTML and CSS today and thought it would be a
I have this problem that always occurs when I'm using display: inline-block to display
I have 6 DIV s with display:inline-block in one line. But they have a
I have html like this: <div> <span style=display: inline-block;height:20px>20</span> <span style=display: inline-block;><img src=img/ex.png/></span> </div>
The HTML I am parsing contains images with inline CSS in a table, can

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.