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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:11:23+00:00 2026-05-24T05:11:23+00:00

I have a site . I want to make 3 vertical divs with equal

  • 0

I have a site. I want to make 3 vertical divs with equal height. For this purposes I change the height of last block in each column/div.

For example, the naming of 3 columns are:

.leftCenter
.rightCenter
.right

Now I wrote a code which set the equal height for .leftCenter and .rightCenter:

var left = $('.leftCenter').height();
var center = $('.rightCenter').height();

var news = $('#newItemsList').height();

if (center < left)
    $('.rightCenter').height(center + (left-center));
else if (center > left)
    $('#newItemsList').height(news + (center-left));

news is the latest subblock in left column (there are 3 images in it). So, if central div is bigger than left div, I change the height of news to make them equal. This code works in Firefox, but doesn’t work in Chrome. That’s the first question. And the last is: how to make equal 3 divs (including right one).

  • 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-24T05:11:23+00:00Added an answer on May 24, 2026 at 5:11 am

    I needed to make elements equal in height and width so I made the following function that allows you to define a height, or width, or really whatever at it. refType would be used if you sent a min-height and needed it to match the height of the tallest element.

    elemsEqual = function (options) {
            var defaults = {
                    'type' : 'height',
                    'refType' : '',
                    'elements' : [],
                    'maxLen' : 450
                },
                settings = $.extend({}, defaults, options),
                max = 0;
    
            $(settings.elements.join(",")).each(function () {
    
                max = Math.max( max, parseInt( $(this).css(settings.type) ) );
    
                if(settings.refType.length) max = Math.max( max, parseInt( $(this).css(settings.refType) ) );
    
            });
    
            max = ((max < settings.maxLen) ? max : settings.maxLen);
    
            $(settings.elements.join(",")).css(settings.type, max + "px");
    };
    
    elemsEqual({elements : ['#selector1','#selector2', ... '#selectorN'], type : 'height'});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site running in django and want to make it available on
I have got many dropdowns in my site and i want to make a
Say you have a pay-site with some online courses. And you want to make
I have a site on joomla and I want to make some specific pages
I want to make some site, is should have user profiles accessible under URL
If I want to make url like this: www.site.com/UK/London/Jobs/98767 Routing url is like: ...
I have a create.js.erb, I want make this: if the user click to create
So i have this videosection, but i want to make a sorting option avaible
Hello i want to make a site that will have a registration page a
I Have done a site but want to redirect it to another subdomain in

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.