What are the steps to center a three-column view and transform it into a two-column view?

I have been struggling to align this Three Column view to a Centered two-column view. Despite trying multiple approaches, I haven't been able to make it work efficiently.

Furthermore, once the alignment is achieved, I notice that it lacks responsiveness on smaller screens.

I would highly appreciate any assistance you could provide. Thank you in advance.

Screenshot:

I aim to achieve a centered two-column view like this.

You can refer to the following code snippet for more context:

#aa-latest-property {
  background-color: #f8f8f8;
  display: inline;
  float: left;
  text-align: center;
  width: 100%;
  padding: 100px 0;
}
#aa-latest-property .aa-latest-property-area {
  display: inline;
  float: left;
  width: 100%;
}
#aa-latest-property .aa-latest-property-area .aa-latest-properties-content {
  display: inline;
  float: left;
  margin-top: 20px;
  width: 100%;
}
.aa-properties-item {
  display: inline;
  float: left;
  margin-top: 30px;
  width: 100%;
  position: relative;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  -ms-transition: all 0.5s;
  -o-transition: all 0.5s;
  transition: all 0.5s;
}
.aa-properties-item:hover {
  box-shadow: 1px 2px 5px 3px #ccc;
}
.aa-properties-item .aa-properties-item-img {
  width: 100%;
}
.aa-properties-item .aa-properties-item-img img {
  width: 100%;
}
.aa-properties-item .aa-tag {
  color: #fff;
  padding: 6px 10px;
  position: absolute;
  left: 15px;
  top: -15px;
}
.aa-properties-item .for-rent {
  background-color: #20ceb3;
}
.aa-properties-item .sold-out {
  background-color: #ff0000;
}
.aa-properties-item .aa-properties-item-content {
  background-color: #fff;
  border: 1px solid #ddd;
  border-top: none;
  display: inline;
  float: left;
  width: 100%;
}
<div class="aa-latest-property-area">

  <div class="aa-latest-properties-content">
    <div class="row">

      <h3>We create an environment for all professionals where the work itself gets stimulated.</h3>
      <div class="col-md-4">
        <article class="aa-properties-item">
          <a href="#" class="aa-properties-item-img">
            <img src="img/core.jpeg" alt="img">
          </a>

          <div class="aa-properties-item-content">

            <div class="aa-properties-about">
              <h3>Core Values</h3>
              <p>We are guided by the core values of: Professionalism, Transparent dealings, Integrity, Dedication, Commitment, Hard work, Fair play and ethical working…</p>
            </div>

          </div>
        </article>
      </div>
      <div class="col-md-4">
        <article class="aa-properties-item">
          <a href="#" class="aa-properties-item-img">
            <img src="img/core.jpeg" alt="img">
          </a>

          <div class="aa-properties-item-content">

            <div class="aa-properties-about">
              <h3>Core Values</h3>
              <p>We are guided by the core values of: Professionalism, Transparent dealings, Integrity, Dedication, Commitment, Hard work, Fair play and ethical working…</p>
            </div>

          </div>
        </article>
      </div>
    </div>
  </div>
</div>
</div>
</section>

Answer №1

Here's a quick solution: add the .col-sm-6 class to the existing div

<div class="col-md-4">

Change it to:

<div class="col-md-4 col-sm-6">

Additional Information:

In Bootstrap, you can create responsive columns using different classes for various screen sizes:

.col-lg-#  /* for large screens */
.col-md-#  /* for medium screens */
.col-sm-#  /* for small screens */
.col-xs-#  /* for extra small screens */

The # represents a number between 1 and 12, indicating the ratio of the width. For example, .col-md-12 will take up 100% of the width on medium screens, while .col-sm-6 will take up 50% of the width on small screens.


For more information, refer to the full documentation:

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

Is there a way to update the value of a property using jQuery?

Is there a way to retrieve the "top" property value along with its inline CSS adjustment? <article class="stack" style="position: absolute; left: 741px; top: 1000px;"> </article> I'm looking to subtract 200px from the top value, in this ...

Why is IE6 adding an additional margin of 50px? My code seems to be causing this issue

Currently I am working on creating a custom IE6 CSS. However, I am facing an issue where an extra 50px is being added to the header div. Even though I have set the header size to 109px, it is displaying at 159px. When I add any element below the header div ...

Converting Beautifulsoup4's findAll() method output of HTML into a list of strings using Python

I'm just starting to explore Python, as I have a project idea in mind that I believe could be achieved by web crawling with Python. Currently following a tutorial series, I know that some consider findAll() to be outdated (I'm not sure why, but ...

Adjust the size of the tabs in CodeSlider

I've implemented a jQuery plugin found here. This is the HTML I'm using: <div class="account_window" style="display:none;"> <div class="coda-slider" id="slider-id"> <div> <h2 class="title">Option1< ...

Error in Layout of Navigation Panel and Tabbed Pages

Working on a school project, I encountered a challenge. I found two useful solutions from the W3 website - a sticky navigation bar and the ability to include tabs on a single page for a cleaner presentation of information. However, when trying to implement ...

What is the best way to format an image within an <a> element?

Below is a code snippet that includes a tags, with one containing an image. <div class="container"> <a href="#">Not styled</a> <a href="#"><img src="image.png"></a> </div> If I specifically want to style ...

steps for eliminating specific words from an input field

In my form, I have 13 input boxes where users can only type text and numbers. I am using the following script to enforce this rule: RESTRICT INPUT TEXT $(function() {//<-- wrapped here $('.restrict').on('input', fun ...

The CSS for SVG circles breaks in Firefox, causing the browser to strip away the radius property

Currently, I am working on creating a progress ring using SVG and CSS. It is functioning well in Chrome; however, Firefox (61.0.1 (64-bit)) is giving me trouble as it does not display the circle. I attempted to apply the method from this question but did n ...

Prevent Repetition of Meta Descriptions and Keywords within Next.js

I'm currently working on my website using Next.js. In order to enhance the SEO performance of my site, I am making an effort to steer clear of duplicate meta tags. My Inquiry According to Next's official documentation, they suggest that using t ...

Strategies for selecting glyphs in SVG fonts based on their Unicode properties

My goal is to extract specific characters from SVG fonts created for music engraving. Music fonts typically include a large collection of characters (> 3500), but I only require a small subset of them for caching glyphs in compressed form to ensure quic ...

Managing the height of a TextArea within a Flexbox environment

After exploring various methods for achieving auto-height in a textarea, I decided to go with the contenteditable approach as it seemed cleaner to me. However, while it worked perfectly on its own, it failed when placed within flexbox containers. I experi ...

Creating a clickable table cell in CSS that maintains vertical alignment of text within

Is there a way to make an entire table cell clickable while still vertically aligning the text inside it? One possible solution is to set the link to display:block and adjust the line height. However, this method may not work if the text spans two lines a ...

Place centered items within a flexbox that uses space-between alignment

When designing a navigation section, I am looking to achieve space-between justification. However, for smaller screens where the navigation items may need to wrap onto multiple rows, I want the items to center themselves instead of aligning to the left whe ...

Tips for revealing a hidden HTML tag

I am currently trying to validate the content within #textd to ensure it is not empty and contains more than 150 characters. If it meets these conditions, I need to transfer the content to another webpage; otherwise, display an error message based on the c ...

Creating responsive layouts with flexible image sizes using Flexbox

My exploration of Flexbox began by testing it on an existing template sourced from a previous stackoverflow question. I am currently focusing on adjusting the image size to better fit within its parent div. max-width: 50px; height: auto; margin:auto; ...

Browser stores cached data for images even after they have been removed and then re-added

Our team is currently working on a web application that relies solely on AJAX and Javascript for its interface. One challenge we have encountered involves dynamic images with cache expiration times set to access time plus 15 minutes. Typically, when these ...

Unable to reset the HTML5 slider successfully

Despite multiple attempts, I have finally reached out for assistance. Here is the code snippet for my slider: <input autocomplete="off" type="range" min="0" max="100" value="50" class="myslider" id="mysliderID-slider" data-fieldid="something"> <i ...

What is the method for setting the current time as the default in a time picker?

Below is a snippet of code where I attempt to implement a date picker and set the current time as the default value. .HTML <input type="time" [(ngModel)]="time"> .TS time; constructor() { this.time= new Date(); } ...

Updating a div's class upon clicking in React

This is my code: render() { return ( <div className='btndiv'> <button className='btn'>Hide</button> </div> ); } I'm trying to change the class of the div from .btndiv to .btndiv ...

Eliminating a pattern with underscore.js or jquery - the complete guide

I am looking to remove the ellipses (...) from a value such as ...India. How can I achieve this using underscore.js, jQuery, or JavaScript? Any tips on how to accomplish this would be greatly appreciated! ...