The Bootstrap image column is not aligning in a straight line

For a project, I need to create inline images like the following:

https://i.sstatic.net/J3oep.png

This is my code snippet:


<div class="col-lg-6">
    <h2>Exchange</h2>
</div>
...

When I expected them to be displayed inline, they ended up looking like this. I thought using col 6 would make them display next to each other:

https://i.sstatic.net/zhZ2j.png

Answer №1

Combine both snippets into a single column setup:

<div class="col-lg-12">
 <div class="row">
   <div class="col-lg-6">
    <h2>Exchange</h2>
     <img src="dummy.jpg" alt="dummy">
     <img src="dummy.jpg" alt="dummy">
     <img src="dummy.jpg" alt="dummy">
   </div>
   <div class="col-lg-6">
    <h2>Community</h2>
     <img src="dummy.jpg" alt="dummy">
     <img src="dummy.jpg" alt="dummy">
     <img src="dummy.jpg" alt="dummy">
   </div>
 </div>
</div>

Answer №2

<div class="row">
 <div class="col-lg-6">
  <h2>Swap</h2>
  <div class="row">
    <div class="col-lg" id="swap">
      <img src="placehold.jpg" alt="placeholder">
      <img src="placehold.jpg" alt="placeholder">
      <img src="placehold.jpg" alt="placeholder">
    </div>
   </div>
  </div>
  <div class="col-lg-6">
  <h2>Society</h2>                 
  <div class="row-lg">
  <!-- Swap -->
    <div class="col-lg" id="society">
      <img src="placehold.jpg" alt="placeholder">
      <img src="placehold.jpg" alt="placeholder">
      <img src="placehold.jpg" alt="placeholder">
     </div>
   </div>
 </div>

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 your email showing up with an unknown sender when using the display function?

I'm facing an issue where the name entered in the input field on a contact form is not being displayed after submitting the email. The headers in PHP were changed and now it shows "unknown sender" instead of the name that was entered. How can I fix th ...

Guide to using jQuery to load an image

I am using this code to load an image and display it within a dialog box. <div id="image_preview" title="Client Photo Preview"> <p><img src="" alt="client image" id="client_image_preview" /></p> </div> $("#client_image_p ...

Unable to assign the value of 'innerHTML' to a null property during an AJAX request

I have searched through numerous articles on this site, but I haven't been able to find the solution I'm looking for. Every time I click a cell in my custom div table, I receive the frustrating message "Cannot set property 'innerHTML' ...

CSS: positioning and resizing image while maintaining aspect ratio

Is there a way to center and resize an image in html/css while maintaining its aspect ratio? I currently have a solution that centers the image, but it does not scale up when necessary. Here is the code snippet: http://jsfiddle.net/4Mvan/438/ .container ...

Unable to locate the hidden element

Attempt to access the attribute of a shadow element resulted in encountering ElementNotVisibleException Element with CSS input[type='checkbox'] is not present on screen <checkbox _ngcontent-ebv-c14="" label="User Access" ng ...

Why isn't the virtual directory in IIS 7 pointing to the root website?

I need to set up a virtual directory in IIS 7 that will point to the root of a website on our server. Here is an example of the structure: Websites: | --- AssetsServer | - /images/ | - /css/ | - etc. | --- demoserver ...

Creating an Innovative Grid Design with Varying Column Widths for Each Row

Seeking advice on achieving a specific layout using HTML. I have attempted to use HTML tables but struggled with creating rows with varying columns. Does anyone have recommendations for grid tools that may be more helpful? Thank you ...

Incorporating a scroll bar into a horizontal display

In troubleshooting this web interface, I encountered an issue related to the horizontal view. The problem is evident in the image below - when in horizontal view, more vertical space is required, prompting the need for a scrollbar to be added between the ...

Alert: The attempt to include_once(headerSite.php) has encountered an error as the file does not exist in the specified directory

I'm a beginner in PHP and encountering the following errors: Warning: include_once(headerSite.php): failed to open stream: No such file or directory in C:\xampp\htdocs\dbtest\index.php on line 3 Warning: include_once(): Failed ope ...

Alert: A notification when navigating away from your site

Is there a way to notify users when they click on an external link that they are leaving your site? <div class="row"> <div class="col-lg-12"> <div class="form-group"> *If you need information on other applicable forms, you ...

Is there a button for invoking a PHP function?

I am fresh to the javascript realm. I've created a function in PHP. How can I trigger it by clicking a button or image in HTML? ...

Creating a vertical stacked barchart using React and Svg without relying on any external libraries

I have been working on a piece of code that utilizes React and SVG to create bar charts without the use of any third-party libraries. Currently, my charts are displayed horizontally, but I would like them to be displayed vertically instead. Despite trying ...

Move the page to the beginning of the vertical stepper upon clicking the "next" button

I am currently working on optimizing a lengthy form to enhance user experience. To illustrate my point, I have come across a simplified example of the code I am dealing with which can be found here. My primary goal is to ensure that when a user proceeds t ...

Pattern matching system to replace only the single occurrence of a character preceding a particular sequence

I have a lot of HTML code that looks like this: <a href="http://example.com/project-a" title="Project A (test)">Project A (test</span></a> <a href="http://example.com/project-b" title="Project B (test)">Project B (test</span> ...

Creating a unique design for a CSS menu with distinct section dividers and stylish onHover effects

Hey there! I'm currently working on a new menu design using UL and LIs elements. I would really appreciate some advice on how to add lines after each LI and properly indent them with the specific bullet image I have chosen. If you're interested ...

Does Jquery AJAX send back raw data or HTML ready for use?

I'm currently developing a mobile app using Jquery Mobile. In order to populate the app with data, I need to make requests to an API and display the information within the app. At this point, I have two possible options: The API returns JSON data ...

Clicking on the current component should trigger the removal of CSS classes on its sibling components in React/JSX

Currently, I am working on creating a navigation bar using React. This navigation bar consists of multiple navigation items. The requirement is that when a user clicks on a particular navigation item, the class 'active' should be applied to that ...

Tips for changing the value of a textview in an HTML document using Java

I'm currently working on a project that involves changing the text value of an HTML file's text view using Java. Within my Java code, I have a value stored in a String variable like this: String message ="HAI"; My goal is to input this "HAI" i ...

Arranging a Bootstrap 4 layout with a 5-row dropdown menu alongside three labeled text input fields

I have a large select input field in my form and I want to optimize the space beside it: https://i.sstatic.net/PV0bT.png I prefer not to use a table as it may not display well on mobile devices. What I am looking for is this layout: https://i.sstatic.ne ...

Tips for turning off specific row elements within a formGroup in Angular

Hey there, I'm looking to disable a specific row that is selected through a checkbox. I've tried the code below but it's not working, so I could use some help with it. Thanks in advance! HTML file code: <form [formGroup]="myFormGroup"& ...