2

For the site I'm currently making, on the right side is a sidebar with some content that extends to the bottom of the page. To the left is the main content of the site, separated into several bootstrap rows and columns, which also go to the bottom of the page. However, these two sides of the page do not end at the same spot, making it look like this:

I scratched out the name in the picture.

I had a fix in mind, but I wanted to ask here before I can implement it tomorrow morning if it'd work. If I set a specific height for the sidebar on the right, and then set specific heights for the containers on the left that add up to that same height on for the content on the right, would that fix this issue in all browsers? I'm hiding the right side content on mobile and tablets, so it's not an issue there. Any help would be appreciated.

Relevant code below, this is for the sidebar on the right, on the left are several rows and columns using bootstrap.

I've tried several things to fix this, like playing with the spacing, but it's clear that will never work on every browser. Please let me know if you need any more information.

<div class="test-container testimonials hidden-sm hidden-xs">
  <!--Testimonial Container -->
  <h3>Testimonials &amp; Reviews</h3>

  <p class="review">"Sed iaculis et enim at aliquet. Fusce eget lorem vel odio aliquam vulputate ut consectetur nisi. Morbi sagittis quis dolor sagittis posuere. Duis porta tellus luctus diam tristique, in sodales odio pretium. Fusce feugiat, neque fringilla auctor mattis,
    lectus mi condimentum diam, et posuere felis ante ut risus. Quisque eget nisi sed ipsum varius interdum. Cras eget diam volutpat, euismod massa id, lobortis erat. Phasellus venenatis pretium urna vitae tempor. Aliquam pharetra orci id blandit posuere."</p>
  <p class="customer-name">-Name</p>

  <p class="review">"Sed iaculis et enim at aliquet. Fusce eget lorem vel odio aliquam vulputate ut consectetur nisi. Morbi sagittis quis dolor sagittis posuere. Duis porta tellus luctus diam tristique, in sodales odio pretium. Fusce feugiat, neque fringilla auctor mattis,
    lectus mi condimentum diam, et posuere felis ante ut risus. Quisque eget nisi sed ipsum varius interdum. Cras eget diam volutpat, euismod massa id, lobortis erat. Phasellus venenatis pretium urna vitae tempor. Aliquam pharetra orci id blandit posuere."</p>
  <p class="customer-name">-Name</p>

  <p class="review">"Sed iaculis et enim at aliquet. Fusce eget lorem vel odio aliquam vulputate ut consectetur nisi. Morbi sagittis quis dolor sagittis posuere. Duis porta tellus luctus diam tristique, in sodales odio pretium. Fusce feugiat, neque fringilla auctor mattis,
    lectus mi condimentum diam, et posuere felis ante ut risus. Quisque eget nisi sed ipsum varius interdum. Cras eget diam volutpat, euismod massa id, lobortis erat. Phasellus venenatis pretium urna vitae tempor. Aliquam pharetra orci id blandit posuere."</p>
  <p class="customer-name">-Name</p>

  <p class="review">"Sed iaculis et enim at aliquet. Fusce eget lorem vel odio aliquam vulputate ut consectetur nisi. Morbi sagittis quis dolor sagittis posuere. Duis porta tellus luctus diam tristique, in sodales odio pretium. Fusce feugiat, neque fringilla auctor mattis,
    lectus mi condimentum diam, et posuere felis ante ut risus. Quisque eget nisi sed ipsum varius interdum. Cras eget diam volutpat, euismod massa id, lobortis erat. Phasellus venenatis pretium urna vitae tempor. Aliquam pharetra orci id blandit posuere."</p>
  <p class="customer-name">Name</p>

  <p class="review">"Sed iaculis et enim at aliquet. Fusce eget lorem vel odio aliquam vulputate ut consectetur nisi. Morbi sagittis quis dolor sagittis posuere. Duis porta tellus luctus diam tristique, in sodales odio pretium. Fusce feugiat, neque fringilla auctor mattis,
    lectus mi condimentum diam, et posuere felis ante ut risus. Quisque eget nisi sed ipsum varius interdum. Cras eget diam volutpat, euismod massa id, lobortis erat. Phasellus venenatis pretium urna vitae tempor. Aliquam pharetra orci id blandit posuere."
    <p class="customer-name">Name</p>

    <p class="review">"Sed iaculis et enim at aliquet. Fusce eget lorem vel odio aliquam vulputate ut consectetur nisi. Morbi sagittis quis dolor sagittis posuere. Duis porta tellus luctus diam tristique, in sodales odio pretium. Fusce feugiat, neque fringilla auctor mattis,
      lectus mi condimentum diam, et posuere felis ante ut risus. Quisque eget nisi sed ipsum varius interdum. Cras eget diam volutpat, euismod massa id, lobortis erat. Phasellus venenatis pretium urna vitae tempor. Aliquam pharetra orci id blandit posuere."</p>
    <p class="customer-name">-Name</p>
</div>
<!-- End Testimonial Container-->
Carl Binalla
  • 5,393
  • 5
  • 27
  • 46

2 Answers2

0

Did you perhaps want to make something like this? (two div have same height, and will follow the height of the higher div, run the code snippet below) then you can use flex. that if you don't need to support older IE version. if you want to support older IE, then you need to do it via javascript.

.wrapper {
  display: flex;
  width: 100vw;
  font-size: 0;
}

.right-content {
  width: 20%;
  display: inline-block;
  font-size: 16px;
  background-color: green;
}

.left-content {
  width: 80%;
  display: inline-block;
  font-size: 16px;
  vertical-align: top;
  background-color: red;
}
<div class="wrapper">
  <div class="left-content">
    <p>
      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </p>
  </div>
  
  <div class="right-content">
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
    <div> Name </div>
  </div>
</div>
Yudi Chang
  • 428
  • 7
  • 17
  • Not quite, I need the bottom most div on the left to line up with the bottom of the right testimonials area. It doesn't appear to be lining up inside fiddle, at least. I haven't looked at flex at all though, so maybe that could lead to a solution. – James Henderson Apr 04 '17 at 03:57
  • You can also use this question as reference http://stackoverflow.com/questions/2997767/how-do-i-keep-two-divs-that-are-side-by-side-the-same-height – Yudi Chang Apr 04 '17 at 04:01
  • Thanks to you, as well, I'll keep both this question and the question you linked bookmarked in case an issue like this comes up again. – James Henderson Apr 04 '17 at 04:18
0

  • Apply a display:flex to the .container
  • Remove the float property on .test-container
  • Remove the margin top on .test-container
  • Take out the red experimental border on .content-container

    fiddle is here

  • repzero
    • 8,254
    • 2
    • 18
    • 40