Strategizing - positioning columns inside a container

Currently, I am a university student working on a project where I am trying to design a layout with multiple images on the left and text along with a button on the right. Despite using Bootstrap classes, I'm facing an issue with aligning these elements properly.

The images below show my current output and the desired outcome: https://i.sstatic.net/wbwZp.png

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

Here is the code snippet:

<style>
   #points {display: block;}
</style>
<div class="row" style="border: black solid 2px;">
  <div class="col-8">
     <img class="img-responsive" src="http://placehold.it/450x250" />
    <div class="row">
      <div class="col-3"> <img class="img-responsive" src="http://placehold.it/210x150" /></div>
      <div class="col-3"> <img class="img-responsive" src="http://placehold.it/210x150" /> </div>
    </div>
  </div>
   <div class="col-4" >
       <div class="property-wrap">
            <div class="text">
              <h3><a href="#">Name </a></h3> 
              <ul class="property_list mt-3 mb-0">
                <li><span class="flaticon-bed"></span>3</li>
                <li><span class="flaticon-bathtub"></span>2</li>
                <li><span class="flaticon-blueprint"></span>1,878 sqft</li>
              </ul>
            </div>
           <div class="text">
               <p>This is some sample text for demonstration purposes. Feel free to edit it as needed. </p>
               <ul > 
                <li id="points">test</li>
                <li id="points">test</li>
                <liid="points">test</li>
                <li id="points" >test</li>
               </ul>
               <a class="btn btn-primary" href="#!">View More →</a>
           </div>
          </div>
        
        </div>
</div>

I'm seeking guidance on how to adjust the width of the text div to align it next to the images without compromising their size.

UPDATE: After implementing the provided code from the answer, my page now appears like this https://i.sstatic.net/NZMeI.jpg

While it's an improvement, I aim to make it more compact - notice the blue line I added.

Below is the revised code:

<div class="row" style="border: red 2px solid; margin: 50px;padding: 10px">
    <div class="col-8">
        <div class="row" style="border: yellow 2px solid; padding: 2px">
            <div class="col-12">
                <img class="img-responsive" src="instagram.jpg" />
            </div>
        </div>
        <div class="row">
            <div class="col-6" style="border: yellow 2px solid; padding: 2px"> <img class="img-responsive" src="product.jpg" /></div>
            <div class="col-6" style="border: yellow 2px solid; padding: 2px"> <img class="img-responsive" src="product.jpg" /> </div>
        </div>
    </div>
    <div class="col-4" style="border: gray 2px solid; padding: 2px">
        <div class="property-wrap">
            <div class="text">
                <h3><a href="#">Name </a></h3>
                <ul class="property_list mt-3 mb-0">
                    <li><span class="flaticon-bed"></span>3</li>
                    <li><span class="flaticon-bathtub"></span>2</li>
                    <li><span class="flaticon-blueprint"></span>1,878 sqft</li>
                </ul>
            </div>
            <div class="text">
                <p>This here is some sample text. This is going to be a mini paragraph. This here is some sample text.
                    This is going to be a mini paragraph. This here is some sample text. This is going to be a mini
                    paragraph. </p>
                <ul>
                    <li id="points">test</li>
                    <li id="points">test</li>
                    <liid="points">test</li>
                        <li id="points">test</li>
                </ul>
                <a class="btn btn-primary" href="#!">View More →</a>
            </div>
        </div>

    </div>

</div>

Answer №1

Give this a try and hopefully it will work for you

 img{max-width: 100%; width: 100%;  border:yellow 2px solid}
 .outer{ border:red 2px solid}
 .right_text{border: gray 2px solid; padding: 15px}
<!DOCTYPE html>
<html lang="en>
<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>

<div class="container outer">
  <div class="row">
  
    <div class="col-sm-6">
      <div class="row">
        <div class="col-sm-12 my-3">
            <img src="https://i.pinimg.com/originals/3b/24/c7/3b24c709566eaab86b97a99b9c084c4c.png">
        </div>
        <div class="col-sm-6">
            <img src="https://i.pinimg.com/originals/3b/24/c7/3b24c709566eaab86b97a99b9c084c4c.png">
        </div>
        <div class="col-sm-6">
            <img src="https://i.pinimg.com/originals/3b/24/c7/3b24c709566eaab86b97a99b9c084c4c.png">
        </div>
      </div>
    </div>
</body>
</html>
    
    <div class="col-sm-6 my-3">
    <div class="right_text">
      <h3>TEXT COLUMN</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris... Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris... Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris... Ut enim ad minim veniam,.</p>
      <button type="button" class="btn btn-success">Success</button>
    </div>
    </div>
    
</div>

If you have any questions, feel free to leave a comment

Answer №2

Check out this example

<!-- Only CSS -->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f3919c9c878087819283b3c6ddc3ddc1">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<style>
    #points {
        display: block;
    }
</style>
<div class="row" style="border: red 2px solid; margin: 50px;padding: 10px">
    <div class="col-8">
        <div class="row" style="border: yellow 2px solid; padding: 2px">
            <div class="col-12">
                <img class="img-responsive" src="http://placehold.it/450x250" />
            </div>
        </div>
        <div class="row">
            <div class="col-6" style="border: yellow 2px solid; padding: 2px"> <img class="img-responsive" src="http://placehold.it/210x150" /></div>
            <div class="col-6" style="border: yellow 2px solid; padding: 2px"> <img class="img-responsive" src="http://placehold.it/210x150" /> </div>
        </div>
    </div>
    <div class="col-4" style="border: gray 2px solid; padding: 2px">
        <div class="property-wrap">
            <div class="text">
                <h3><a href="#">Title </a></h3>
                <ul class="property_list mt-3 mb-0">
                    <li><span class="flaticon-bed"></span>3</li>
                    <li><span class="flaticon-bathtub"></span>2</li>
                    <li><span class="flaticon-blueprint"></span>1,878 sqft</li>
                </ul>
            </div>
            <div class="text">
                <p>Some text goes here. This is a sample paragraph that can be used for demonstration purposes.
                    Some more text to fill up the space and make it look like real content. Lorem ipsum dolor sit amet.</p>
                <ul>
                    <li id="points">test</li>
                    <li id="points">test</li>
                    <li id="points">test</li>
                        <li id="points">test</li>
                </ul>
                <a class="btn btn-primary" href="#!">Read More →</a>
            </div>
        </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

Enhancing Image Quality upon Hovering

Is there a way to prevent the content of the article from moving when an image becomes absolutely positioned? The issue I am facing is that the image overlaps its container with overflow: hidden only when the img is absolute positioned. article { back ...

Pictures Unavailable to Show in Table

I've been working on a project where I need to insert some images into a table. Usually, this isn't an issue for me. However, today when I added the images to the table, all I see is a square border with the alt text inside it. I'm confident ...

The DIV refuses to center-align

I am struggling to center a div element. I have tried using margins (margin: 0 auto) and left/right CSS attributes (left: 50%, right: 50%), but the result is not as expected. Can anyone point out where the problem might be? EDIT: The issue I'm facin ...

Dropdown items and Hamburger icon are not collapsing or functioning properly even when they resize correctly

I've recently started learning web development using Bootstrap, and I'm facing an issue with the navbars. Specifically, the dropdown/collapse feature is not working as expected with the dropdown items and hamburger icon. I've attempted to i ...

I'm attempting to make this script function correctly when an image is loaded

Can anyone help me figure out how to make this script function on image load instead of onclick? I came across the script on stackoverflow, but it was originally set up for onclick. I want it to work for onload or .load HTML====== <div id="contai ...

Is there a way in HTML to navigate directly to a specific element on another page, even if it is not currently visible

I have used an anchor to navigate to a specific element on another page from the current page. However, the specific element I want to navigate to is not currently visible because it is controlled by JavaScript to keep the page short. The element is only s ...

Is there a way to automatically activate the "Add" button when I hit the enter key in the text box?

Being someone who relies on to-do lists, I implemented a system where you can input tasks into a textbox and click the add button to see them listed below. However, I found it cumbersome to keep clicking the add button every time I wanted to quickly add mu ...

React is not applying the font as expected

Currently, I am working on setting up a @font-face in my index.css file: @font-face { font-family: "Raleway"; src: url(../assets/fonts/Raleway/Raleway-VariableFont_wght.ttf) format(truetype), } Next, I am trying to apply this font family ...

Can Webpack be used to produce only CSS files without generating the output.js file?

I've integrated Webpack into my project alongside the extract-text-webpack-plugin. Within my project, I have various build scripts. One of these scripts focuses solely on bundling and minifying CSS. While utilizing Webpack for other tasks, I decided ...

Issues with Line Chart in D3: Scaling and Zoom not functioning as expected due to ClipPath limitations

I am utilizing D3 version 4 to process data and create a graph based on dates. Although I have successfully adjusted everything to be compatible with zoom functionality, I am struggling to prevent the line from extending beyond the chart axes. I would pre ...

The Ultimate Guide to HTML Scrolling Default Pages

I found a JSFiddle link to help me create a sliding page content: http://jsfiddle.net/sg3s/rs2QK/ Although I'm quite pleased with it, I am trying to make the first target show up by default. I attempted to replace the panel class of the first target ...

"Utilizing ng class with an array of objects: A step-by-step guide

I am facing a scenario in which my response appears as follows: "currency" : [ { "_id" : ObjectId("584aad5d3e2537613e5f4c39"), "name" : "USD" } ], I need to enable my checkbox based on the currency name. I attempted the followi ...

When I incorporate JavaScript logic into my navigation, the Anchor Links fail to work properly

Currently facing an issue with my navigation bar where the category jump labels should change their bootstrap class when the corresponding heading is visible in the viewport. While everything works fine up to this point, adding the second event listener fo ...

The sticky and flexible footers and headers CSS feature is functioning perfectly in WebKit, though it seems to be having difficulties in

I'm working on constructing a layout that features a header and footer with flexible heights, while the middle section takes up the remaining space. If there is overflow in the middle section, a scroll bar should appear specifically for that section. ...

How come the HTML content stored in a Mongodb document in JSON format is showing up as plain text on the webpage?

I am currently working with a mongo database that contains a document including some HTML content. However, when I attempt to display this content on a webpage, it appears as plain text rather than rendered HTML. Here is the JSON snippet showcasing the HTM ...

Tips for choosing certain viewports using media queries

I am attempting to target a specific range between 767px and 1024px. This should be applicable to the screen, as well as iPad portrait mode, but NOT for iPad in landscape mode. I have experimented with various queries, but none of them have yielded the d ...

How can you make a Dropdown Box with Javascript?

My current table setup is as follows: <table> <tbody> <tr> <td>List 1</td> <td>List 2</td> <td>List 3</td> <td>....</td> </tr> <tr> <td>This section would be the dropdown ...

Child element's CSS is failing to apply, while the parent element's styling is functioning correctly

I have developed a small quiz application where, after answering questions, I display a progress bar. The issue I am facing is with the styling of the progress bar. I have set up two div elements for this purpose - one as the parent element (id = "progress ...

Unable to display a Google map within a webview when viewing a local HTML file

I am currently working with a local HTML file called basicmap.html that includes the following code: <!DOCTYPE html> <html> <head> </head> <body> <div id="map"></div> <script> ...

Exploring the Functions of Bootstrap's Top Navbar and Sidebar

I attempted to utilize the top navigation and sidebar components in Bootstrap 4, but encountered issues. My header.jsp file serves as the top navigation bar, which is connected to the sidebar page using an action tag like this: <header> <jsp ...