The design features a prominent large image positioned on the left side, accompanied by two vertically-oriented images placed using

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

I'm struggling to generate the necessary code to display images properly on my website. Despite numerous attempts, I can't seem to position the images correctly and it's becoming quite challenging...

Below is the code I have been experimenting with:

        <div class="row">
         <div class="col-lg-9 col-md-9">
           <div class="row adventure-detail-card">

              <!--Grid column-->
              <div class="col-lg-9 col-md-8 gd-cont">
  
                 <img src="../../../assets/adventures/resort/resort1.jpg" class="img-cont"
                    alt="">
              </div>
              <!--Grid column-->
   
              <!--Grid column-->
              <div class="col-lg-3 col-md-4 gd-cont">
                 <img src="../../../assets/adventures/resort/resort2.jpg" class="right-img mb-4 mt-4"
                 alt="">
  
                 <img src="../../../assets/adventures/resort/resort3.jpg" class="right-img"
                 alt="">
  
              </div>
  
         </div>
         <div class="col">

         </div>
     </div>
     </div>
  </div>

Css here:

 .img-cont {
  width: 100%;
  height: 100%;
  background-size: cover;
  flex: 1;
 }

 .right-cont {
    display: flex;
    flex-direction: column;
    flex: 0 0 50%;
  }

  .gd-cont {
    padding: 0px 0px, 0px 0px;
   }
  .right-img {
     width: 190px;
     height: 190px;
     background-size: cover;
     flex: 50%;
   }

Answer №1

To ensure your images fit properly, utilize Bootstrap's img-fluid class and adjust the containers, rows, and columns as needed for your desired layout.

<style>
    .bottom-border {
        border-bottom: 1px solid rgba(0,0,0,0.125);
    }
</style>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1b7974746f686f697a6b5b2f352d352b">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6949999828582849786b6c2d8c0d8c6">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>

<div class="container-sm pt-5">
    <div class="row">
        <div class="col-md-9">
            <div class="row adventure-detail-card">
                <div class="card w-100" style="padding-top: 15px; padding-bottom: 15px;">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-8">
                                <img src="https://via.placeholder.com/1200x1160.png" class="img-fluid mb-3 mb-md-0" alt="">
                            </div>
                            <div class="col-md-4 d-flex flex-column justify-content-between">
                                <img src="https://via.placeholder.com/360x360.png" class="img-fluid mb-3 mb-md-0" alt="">
                                <img src="https://via.placeholder.com/360x360.png" class="img-fluid mb-3 mb-md-0" alt="">
                            </div>
                        </div>
                        <div class="row pt-2">
                            <div class="col">
                                <h1>Sunshine Resort</h1>
                                <p class="text-secondary bottom-border"><strong>Relax and unwind yourself</strong></p>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="card" style="padding: 15px;">
                <h1 class="bottom-border">Sold Out!</h1>
                <p>
                    This adventure is currently sold out. But there&rsquo;s a lot more to <span style="color: #ffa500;">explore</span>.
                </p>
            </div>
        </div>
    </div>
</div>

Remember, you only need to specify the column size once (e.g., use col-md-9 instead of duplicating with col-lg-9 col-md-9).

Answer №2

Feel free to test this out.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<div class="container">
  <div class="row">
    <div class="col">
      <img src="https://www.w3schools.com/images/picture.jpg" style="width:100%" />
    </div>

    <div class="w-150"></div>
    <div class="col" style="width:100%">
      <img src="https://www.w3schools.com/images/picture.jpg" style="width:50%" />
      <img src="https://www.w3schools.com/images/picture.jpg" style="width:50%" />
    </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

The art of jQuery: Effortlessly animate the deletion of a CSS property

When using jQuery, I often "collapse" certain DOM elements by decreasing their width to 0px and fading them out. Here is an example: $(".slideoutmenu").animate({ width: 0, opacity: 0}, function() { $(this).hide(); }); The widths of these elements can var ...

Can you explain the purpose of the charset attribute in HTML and why it is not supported in HTML5?

Being new to the programming realm, I've been diving into basic concepts and have hit a roadblock with the charset attribute in HTML. Can anyone lend a hand in unraveling this mystery for me? ...

Having trouble determining the height of a div element?

I'm struggling with a seemingly simple problem that I just can't seem to solve. I'm trying to get the height of my div element, but for some reason it keeps returning 0. Even when I inspect the element in Chrome, it shows me a height. Here&a ...

Why hasn't the string been properly encoded?

Consider the scenario below: string text = "this is an example of formatted \"string\""; When I display this as a plain string in my web API method: return Ok(text) it will output: this is an example of formatted "s ...

Incorporate New Material into DIV Using a Specific Class Identifier

I need to customize the default output of Wordpress menu using <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>. My goal is to change the appearance of pages with submenus. Currently, pages with a submenu are fo ...

Tips for downsizing a large image to fit into a smaller area

I am working on a page layout that features a small circular navigation element. However, I am facing an issue with fitting a large picture within the boundaries of this small circle without it overflowing and causing alignment problems. Does anyone have ...

What is the best way to smoothly transition in an image that is dynamically set using Angular?

I am using Angular to set a background image for my page, but the current loading behavior is not visually appealing as the image loads from top to bottom. I would like to implement a fade-in effect or load the image from a blurry view to enhance the user ...

Issue with Bootstrap 4 collapse not functioning properly within a flex container

I'm encountering an issue with Bootstrap 4 collapse. Everything works as expected unless I add the "d-flex" class to my form tag. When I include the "d-flex" class, the form is initially displayed. Upon clicking #reservas_button, the form toggles fro ...

How can I assign an attribute to an element that has been dynamically generated?

Upon receiving a response from a $.post, I found that it contains various elements including <a> and <img>. To prevent the <a> element from performing its default actions when clicked, and to disable the draggable option for both the < ...

Obtaining precise information through clicks using Ionic and Firebase

Currently, I am diving into learning the Ionic framework and Firebase using AngularFire. My current project involves creating a contacts application with multiple user accounts, where each user's contacts are displayed in a list. When a contact is cli ...

What's the best way to ensure consistent spacing between a label and input field, regardless of the length of the text?

Imagine a scenario where there are 10 input fields, each preceded by a span tag on the left side indicating what should be entered. While working on this setup, I encountered an issue - how can I create a consistent space between the span tag and the input ...

Is there an image overlapping another image?

Currently, I am working on developing a website for a Food Cart project in my class. One of the key features I want to incorporate is the ability for users to click on an image of a plate and have a different image representing the food appear on top of it ...

Aligning text to the right within a div that is placed inside an image element

I have a simple structure that looks like this: <div class="inline"> <div class="photo-group thumb_wrapper"> <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQYZ35nsT0CRTlGBtNmPHikH74wXBldsPe8LQYfhXnzADYo-xSU" ...

Using Vue to iterate through a list with conditional logic is as intuitive

I am completely new to vue, and facing a challenge with a conditional situation that I usually handle with PHP. My goal is to iterate through an element with a condition inside it. Below is how I envision the structure: <ul> <li>A</li&g ...

Learn the technique of looping through multiple HTML elements and wrapping them in Vue.js easily!

i need to wrap 2 HTML elements together Here is my code snippet using Vue.js <tr> <th v-for="(item9,index) in product_all" :key="item9.id"><center>Qty</center></th> <th v-for="(item99,index) in product_all" :key=" ...

What is the best way to position a collection of images together for optimal

I'm a new web developer and I'm struggling with aligning images on my page. I've added the images successfully, but I want them to fill the entire space of the previous div. I'm not concerned about the aspect ratio, just the alignment. ...

Is there a way to display all of them inline in Woocommerce?

Can anyone assist with making each of these inline? https://i.sstatic.net/YF9bu.png <div class="atc_nsv"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <ul> <li><img class="ad lazyloaded" data-src="//cdn.shopif ...

Angular JS Profile Grid: Discover the power of Angular JS

I came across an interesting example that caught my attention: http://www.bootply.com/fzLrwL73pd This particular example utilizes the randomUser API to generate random user data and images. I would like to create something similar, but with manually ente ...

Tips for arranging bootstrap body into floating containers

I'm interested in creating distinct text sections on my webpage, similar to floating rectangles like those seen on the website . Can anyone offer guidance on how I can achieve this effect? Thank you for your help! ...

Unable to retrieve the DOM element using jQuery

I'm currently facing an issue with fetching a DOM element from a jQuery selector array. var index = $(this).index(); $titleElement = $(".title:not(.small)")[index]; Unfortunately, the code above only gives me the text and not the actual DOM element ...