Ensuring that two columns in Bootstrap 3 have equal heights while including padding

I would like to achieve this design without using JavaScript. Here is a screenshot for reference:

This is what I have created so far using Bootstrap 3. The CSS is inline due to the use of less, which makes it easier :)

HTML

 <section class="container-fluid" style="background-color:Red;
  background-size: cover; padding-top:145px; padding-bottom:145px;">
    <div class="container">
      <div class="row">
       <div class="col-md-6">
       <div class="element" style="background-color:white;  opacity:.90;
  -moz-opacity:.90; 
  filter:alpha(opacity=90); padding-top:20px; padding-bottom:20px; margin-top:20px; margin-bottom:44px; margin-right:15px; padding-left:15px;">
              <h2  class="color-brand">HEADING 2</h2>
              <p class="color-grey">Hello Mate</p>
            </div>
            </div>
   <div class="col-md-6">
        <div class="element" style="background-color:white;  opacity:.90;
  -moz-opacity:.90; 
  filter:alpha(opacity=90); padding-top:20px; padding-bottom:20px; margin-top:20px; margin-bottom:44px; margin-right:15px; padding-left:15px;">
              <h2  class="color-brand">HEADING 2</h2>
              <p class="color-grey">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
            </div>
            </div>
          </div>
</section>

Here is the working jsfiddle link:

http://jsfiddle.net/D9tc4/

Answer №1

To create a unique spacing effect, try utilizing a negative margin in your CSS code like so:

.box{
    padding:10px;
    margin-top: -20px;
    padding-bottom: 30px;
}

Check out the live demonstration here: http://www.example.com/demo123

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Divs should be of consistent and adjustable height

I am in need of a layout with three columns: left column (with a red background) center column (with a yellow background) right column (with a black background) This is the HTML structure I have in mind: <div id="container"> <div id="left_ ...

What causes the scrollbar to not extend to the bottom when connected to another scrollbar via a JavaScript equation?

I have been working on a code that involves multiple scrollbars that are all linked together. When you move one scrollbar, the other two will move proportionally. However, due to differences in width, the scroller doesn't always reach the end of the s ...

Enhancing OpenSeadragon images with custom overlays and managing error messages

Currently, I am experimenting with the Basic Single-Row Tile Source Collection example using the same configurations and tile sources outlined in the example. However, I am encountering difficulties in adding overlays to the first and second images as int ...

Is it possible to adjust the width of a parent element based on the number of child

In this particular example, I have structured a header with a logo-container positioned on the left side, a menu in the center, and a button on the right. The menu consists of 5 top-level items and 2 sub-menus. <div class="container"> <div cla ...

Switch button - reveal/conceal details

I am looking for assistance in toggling the visibility of information when clicking on an arrow icon. I have attempted to use JavaScript, but it was unsuccessful. My goal is to hide the information below by clicking on the downward-facing arrow image , an ...

Issues with iOS 7's absolute positioning not functioning properly within a table-responsive container

I successfully implemented fixing the first two left columns in my tables by following the instructions on . The columns are only fixed when the screen size is less than 768px, making the table scrollable (check it out on jsFiddle). This functionality work ...

Guide to animating an HTML element with CSS

Recently, I've been pondering the process of animating an HTML element solely through CSS. Unfortunately, my knowledge on the subject is quite lacking... I attempted to utilize the animate keyword in pursuit of this goal ...

Targeting an HTML form to the top frame

Currently, I have a homepage set up with two frames. (Yes, I am aware it's a frame and not an iFrame, but unfortunately, I cannot make any changes to it at this point, so I am in need of a solution for my question.) <frameset rows="130pt,*" frameb ...

I am unable to pass a variable through a callback, and I cannot assign a promise to a

Currently, I am facing a challenge with my code where I need to loop through a hard-coded data set to determine the distance from a user-entered location using Google's web API. The issue lies in passing an ID variable down through the code so that I ...

Is there a way to convert a URL into a clickable link and retrieve the YouTube code embedded within

I have retrieved a string from the database using PHP and I want to echo it. Within this string, there is a YouTube link that I would like to make clickable, as well as extract the YouTube code at the end of the link. How can I achieve this? For example: ...

Getting the most out of Twitter Bootstrap: How to effectively implement the `.btn` class in a navbar?

Currently, I have set up a navigation bar for the usual navigation options, and now I want to include buttons for both Sign in and Sign up. To implement this, I am using an a tag with the classes btn btn-large btn-success. However, it seems that the navba ...

There seems to be an issue in Angular as it is unable to retrieve /

I'm encountering an issue with my simple application where I am receiving the error message "Cannot GET /." Also, in the console, I see this error: TypeError: Cannot read property 'checked' of null at Object.SL_BBL_locer. I'm unsure ab ...

Scrollable container with jQuery draggable functionality

I am currently working on implementing a draggable list that I want to contain within a scrollable div. $( ".draggable" ).draggable(); Here is the fiddle I have created for this: http://jsfiddle.net/YvJhE/660/ However, the issue I am facing is that the ...

Tips on displaying inline span text within an anchor element, above the anchor text

Check out the code I've created below: .tooltip1 { z-index: 1; position: relative; } .tooltip1 .tooltiptext { visibility: hidden; width: 300px; ...

Concealing anchor and span elements using CSS in Internet Explorer 7

I decided to simplify things by creating a style within the document to address my specific issue. The problem I encountered involves a row of 4 links that are designed to resemble buttons. I have chosen to hide the Next link (the 3rd item) using CSS. Whil ...

Bring to life a dashed slanted line

After incorporating the code from this post on Stack Overflow about animating diagonal lines, I was pleasantly surprised with how well it worked. However, my next goal is to style the line in such a way that it appears dotted or dashed, as opposed to one ...

Tips on setting the ajax parameter contentType to "html"

I'm encountering an issue where the variable "myvariable" is passing as null. Can anyone provide guidance on what I might be doing incorrectly? $.ajax({ type: "POST", url: "/MyController/MyAction", data: JSON.stringify({ items: my ...

Python Selenium- Extract and print text from a dynamic list within a scrolling dropdown element

I am currently working on a project using Selenium and Python to extract a list of company names from a dropdown menu on a javascript-driven webpage. I have successfully managed to reveal the list of company names by clicking the navigation button, and eve ...

Is there a way to modify the drop-down button so that it can display the links from the side while keeping the button fixed in place?

https://i.stack.imgur.com/ftj6w.pnghttps://i.stack.imgur.com/VuCDo.png [I am new to creating websites and any assistance is welcomed.] This code snippet is used to display dropdown button links in a list format. My goal is to make the links appear on the ...

Video with dynamic sizing doesn't adapt properly

I successfully achieved my main goal, which was to have a background video at the top of my page. However, I am facing an issue with making the video responsive. Currently, as I decrease the screen size, the video shrinks in both width and height rather th ...