Utilizing Bootstrap for Efficient Image Alignment

I'm encountering an issue with my code and I am unsure of how to fix it.

The current state of my code is different from the desired outcome

https://i.sstatic.net/Ti1kK.jpg

As you can see, the image above does not match the appearance of the image I aspire to achieve. How can I make the lower picture resemble the one I want?

Below are the snippets of my code:

CSS

.img-container {
 height: 500px;
 display: flex;
 }

.img-big {
 background-image: url('/assets/icons/people-crowd-child-kid-large.jpg');
 background-size: cover;
 flex: 1;
 }

.img-small {
 display: flex;
 flex-direction: column;
 flex: 0 0 50%;
 }

.img-small1 {
 background-image: url('/assets/icons/13-Cuidados-alternativos-en-     familia.jpg');
 background-size: cover;
 flex: 50%;
 }

.img-small2 {
 background-image: url('/assets/icons/man-person-cute-young-large.jpg');
 background-size: cover;
 flex: 50%;
 }

HTML

<div class="row">
<div class="col-md-8 img-container">
    <div class="img-big img-responsive"></div> 
</div>
<div class="col-md-4 img-small">
     <div class="img-small1"></div>
     <div class="img-small2"></div>
</div>

Answer №1

To display the images, use img elements instead of setting them as background images:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
  <div class="col-md-8 img-container">
    <img class="img-responsive" src="http://placehold.it/1000x500" />
  </div>
  <div class="col-md-4 img-small">
     <img class="img-responsive" src="http://placehold.it/250x250" />
     <img class="img-responsive" src="http://placehold.it/250x250" />
  </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

The challenges of $location.search().name and base href in application URLs

I am working on an Angular app and my URL appears as http://localhost:8080/personal?name=xyz. To extract the 'xyz' value in JavaScript, I am using $location.search().name. Here is a snippet of my code: app.js app.config(function ($locationProv ...

Text box is not automatically filling up when selecting from dropdown menu

I am currently facing an issue with a dropdown box that offers three different selections. I want the Group ID associated with the selected group to automatically populate in the textbox below. How can I achieve this functionality? Whenever I make a selec ...

Expanding a JavaScript list using HTML inputs

I have a script where a grid dynamically displays a list of words. Is there a way to populate the word list in the grid using HTML? Currently, I am doing this... var listOfWords = ["mat", "cat", "dog", "pit", "pot", "fog"]; Can additional words be adde ...

Is it possible to update an anchor tag using BeautifulSoup directly?

I am aiming to retrieve all anchor tags from an HTML document, regardless of their location or depth within the structure. Once these links have been gathered, I intend to manipulate them and create new links. My goal is to update the original HTML conten ...

The line breaks in elements occur when the combined widths add up to 100%

Is there a way to display an input and a button inline, with the input taking up 70% of the row and the button taking up 30%? I tried setting the CSS for the input to 70% and the button to 30%, but they keep breaking onto separate lines. How can I solve ...

Geolocation API for determining altitude

When using the geolocation API, I am experiencing no issues with latitude and longitude. However, I have encountered a problem with Altitude. For instance, when I retrieve the coordinates for my current location using my mobile phone with integrated GPS, i ...

Coloring a table in vue.js based on performance rankings

I'm facing an issue with sorting my data performance in vue js. Here is the script I have created so far: <template> <div> <div class="row"> <h2> Campaign Performance </h2> <table class=&q ...

Utilizing Custom Script Tag Types in Visual Studio for Enhanced HTML Template Functionality and Improved Syntax Highlighting

Currently, I am utilizing Visual Studio 2012 for editing HTML and JavaScript. My approach involves inserting templates using partial views in inline script tags (view code below). The use of AngularJS, a Javascript framework, dictates that the type must be ...

Generate visual representations of data sorted by category using AngularJS components

I am facing an unusual issue with Highcharts and Angularjs 1.6 integration. I have implemented components to display graphs based on the chart type. Below is an example of the JSON data structure: "Widgets":[ { "Id":1, "description":"Tes ...

Struggling with css margins and div image constraints, seeking guidance and tips for resolution

Struggling with creating a dynamic gallery that works smoothly in jsfiddle but encounters multiple issues when integrated into WordPress. The main problem is the excessive stretching of margins between image titles and meta-data, leading to misalignment an ...

Error message: Laravel 8 and Ajax - 405 Error - Method Not Allowed

Whenever I try to input something into the form, it keeps showing an error message saying "405 Method not allowed". How can I resolve this issue? This is my route: Route::get('/search' , [HomeController::class, 'searchPost']) ...

I noticed an excess of white space on the right side of my Angular website

Check out my website here. Everything seems to be functioning correctly, however, there is an issue with scrolling on mobile. It should only scroll up and down, not left and right! I have noticed a strange white space on the right side of my site when view ...

Issues with maintaining the checked state of radio buttons in an Angular 4 application with Bootstrap 4

In my Angular 4 reactive form, I am struggling with the following code: <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary" *ngFor="let item of list;let i=index" > <input type="radio" name="som ...

Stop Gulp Inline CSS from enclosing HTML content within html and body elements

I need to work on a piece of HTML that I plan to copy and paste directly into an existing document. Here is the code snippet: <div id="someDiv"> </div> <script src="js/someScript.js" inline></script> <style> div#someDiv { ...

Achieving targeted text display on specific viewports using the visible class in Bootstrap

I've recently delved into learning Bootstrap, and I'm experimenting with creating a responsive page where certain divs will only be visible on specific viewports. I used classes like visible-xs, visible-sm, visible-md, and visible-lg for the diff ...

Utilizing Jquery.validate() for personalized checkbox validation

My struggle lies in integrating jQuery.validate() with custom-designed checkboxes. I am unable to achieve the desired outcome where, upon clicking SUBMIT without selecting any checkboxes, an error should be displayed in the respective label. Despite having ...

struggling to develop a sophisticated 'shopping cart organization' program

I am in the process of creating a database for video spots, where users can view and modify a list of spots. I am currently working on implementing a cart system that automatically stores checked spot IDs as cookies, allowing users to browse multiple pages ...

Is there a way to modify the variable in order to switch the font of the heading every second using CSS and JavaScript?

I'm trying to create a heading that changes fonts every second, but I'm having trouble changing the variable to set it to another font. Check out my code here. Despite watching tutorials, everything seemed too confusing. var root = document.q ...

Tips for effectively showcasing dynamic data retrieved from a database

I need to showcase my dynamic data from a database in a specific format that can accommodate anywhere from one to five variables. https://i.sstatic.net/pPQZE.png https://i.sstatic.net/gSJw6.png How can I effectively display and present the data using HTML ...

Guide to Designing a Three-Column Layout Using Only CSS

I'm currently facing an issue with the alignment of the content section on my webpage which consists of three columns. The DIVs are not floating as expected. Below is the code I am using: <div id="content"> <asp:ContentPlaceHolder ID="Ma ...