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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:40:29+00:00 2026-06-17T11:40:29+00:00

I have two divs, one on the left and one on the right. If

  • 0

I have two divs, one on the left and one on the right. If the description on the left is longer than the image (180px), then the image stays at the top. Or, vice versa, if the text is shorter than the image, than it is the text to be aligned at the top.

I would like both to be always aligned at the middle.

I think what I need is display:table-cells and then vertical-align:middle, but so far I had no luck getting this to work.

  <div class="span4">
   <img class="thumbnail" src="http://placehold.it/290x180" width="290" height="180" alt="Second function" />
  </div>
  <div class="span6 offset1">
    <h3>Element</h3>
    <p>Description.</p>
  </div>
  • 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-17T11:40:30+00:00Added an answer on June 17, 2026 at 11:40 am

    Started looking at this:
    Vertically centering a div inside another div

    took some of the style elements mentioned there and applied it here:
    http://jsfiddle.net/kgJ2M/3/

    Once I put height values in the separate divs, it gave the description room to center rather than centering inside a box that it just fit inside.

    hope it’s not to late for this issue. It seems to be a common question.

    .span4 {
      float:left;
    }
    .span6{
      height:180px;
      width:100px;
      vertical-align:middle;
      display:table-cell;
      border:1px solid blue;
    }
    .containerspan {
      border:1px solid green;
      height:200px;
      display:table-cell;
      vertical-align:middle;
      text-align:center;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two divs, one with float: left and the other one with float:right.
I have two divs, one on the left, and one on the right side
I have two divs. One on the left and one on the right. The
I have two divs in my website,one is left side and other is right
I have two divs, a left and a right one. The left one takes
I have two divs within a container. One floats left and one floats right.
i have two divs one floated to the left and the other to the
I have two divs floated next to one another: <div id=parent> <div id=child_1 style=float:left>
I have a simple page layout with two divs--one on top, and one on
I have two DIVs inside one DIV. One of the DIVs is floated left,

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.