Exploring innovative ways to extend outside the boundaries of the container without compromising on responsive design

I am facing a challenge in building this page as I am unsure of how to make the image extend beyond the bootstrap container while still maintaining a responsive layout. Is there a way to achieve this without resorting to absolute positioning for every individual device?

Designing for Web Screens

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

Designing for iPads and smaller screens

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

Answer №1

Check out this responsive two-column design that closely resembles your current layout.

By utilizing Bootstrap's column ordering feature, the text and image blocks switch places on smaller screens for a seamless viewing experience.

div {
  outline: 1px solid red;
}

.img-absolute {
  position: absolute;
  top: 80px;
  right: 80px;
}

.div-black {
  position: absolute;
  top: 40px;
  right: 40px;
  background-color: black;
  width: 280px;
  height: 280px;
}

@media (max-width: 990px) {
  .img-absolute {
    right: 380px;
  }
  .div-black {
    right: 340px;
  }
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet"/>

<div clas="container">
  <div class="row">
    <div class="col-lg-6 order-1 order-lg-2">
      <h4>Lorem Ipsum</h4>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Integer feugiat scelerisque varius morbi enim. Duis ut diam quam nulla porttitor massa id neque aliquam. Non pulvinar neque laoreet suspendisse interdum consectetur. Tempus urna et pharetra pharetra massa massa ultricies mi quis. Urna duis convallis convallis tellus id interdum velit laoreet id. Lacus vel facilisis volutpat est velit egestas. Eros donec ac odio tempor. Sapien et ligula ullamcorper malesuada proin libero nunc consequat interdum. Morbi tempus iaculis urna id volutpat lacus laoreet. Ultricies mi eget mauris pharetra et ultrices. Habitasse platea dictumst vestibulum rhoncus est pellentesque. Mi quis hendrerit dolor magna eget est lorem. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus. Nulla posuere sollicitudin aliquam ultrices sagittis orci. Neque aliquam vestibulum morbi blandit cursus risus at.</p>
    </div>
    <div class="col-lg-6 col order-2 order-lg-1">
      <div class="div-black"></div>
      <img class="img-absolute"
           src="https://picsum.photos/600/300" />
    </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

What are some ways to prevent popups from being hidden by CSS?

I encountered a problem with my popup that I created using pure CSS. When I move my mouse to the top or bottom of the window, the popup disappears. However, if my cursor is in the body area, the popup appears as intended. I have not used any JavaScript in ...

Replacing a <p> element using solely CSS: the ultimate guide (other techniques are ineffective)

After reviewing this particular question, I found that the suggested solution did not yield the results I was hoping for. Here is a visual representation of the issue: https://i.sstatic.net/Nj5V0.png My goal is to substitute the text "Select subscription ...

I utilized the `<script src="sample.pdf"></script>` tag in my HTML code and surprisingly, the JavaScript within the PDF document was still able to execute

Recently, I encountered a situation where I included a PDF file with JavaScript code in the src attribute of a script tag in my code. Surprisingly, the JavaScript code executed without any issues. This made me wonder if I can use any type of file extension ...

margin-top: automatic adjustment, with a minimum of 50 pixels

I am trying to add a minimum of 50px margin to the top of my footer tag using CSS, but I haven't been successful with the min() function. I'm not sure if I am overlooking something or if there is another correct approach to achieve this. * { ...

A two-column bootstrap design with zero padding or gaps

This is the layout I am aiming for: https://i.sstatic.net/4LgVB.png Below is the code I currently have: <div class="row "> <div class="col-lg-6 row-eq-height push-right"> <img src="1.jpg" class="img-responsive"> ...

Troubleshooting: Issue with CSS chaining adjacent sibling and :checked functionality

When I click the second radio button in Chrome, why does paragraph 2 stay highlighted and paragraph 4 doesn't get highlighted? Is this a bug with Chrome? HTML: <input type="radio" name="toggler" checked /> <p>Paragraph one</p> < ...

Utilizing Node.js to dynamically inject variables in SASS compilation

I am currently working on an application where I need to dynamically compile SASS before rendering it on the client side (a caching system is in the works, so no worries there). At the moment, my tool of choice is node-sass and so far, everything is runnin ...

What is the best 'event' to pair with an <input/> element in iOS/Android development?

Looking for a way to toggle results when a user starts typing in a search field? Here are some event options: mousedown / mouseup touchstart / touchend focus You could also consider using the "change" event instead of "click" to check for text input an ...

What could be the reason behind the significant void in the grid I designed?

I'm currently learning how to utilize the grid container and have successfully created a grid with 2 images on top, 2 on the bottom, and one that stretches vertically on the left side. While I have arranged the grid as desired, I am facing an issue wi ...

The onClick event is failing to function properly due to the presence of nested tags within

My onClick event is not working with this HTML code <a class='list-group-item media' href='#'> <div class='media-body'> <div class='pull-left'> <div class='lg-item ...

Establishing the destination for an onclick event to a designated spot

I have divided my body content into two parts. The left side contains a map and buttons, where clicking on a button displays results from Arad.php in another window. How can I target the second half (split right) of my body? <body> <div cla ...

Jquery scroll animation not reaching the intended position when scrolling upwards

While developing a new feature for my music player, I encountered an issue with centering the track/div upon clicking in the scrollable parent div. Sometimes it doesn't scroll to the center as intended and instead scrolls erratically to the top of the ...

Employing jQuery to change the name of a div and subsequently selecting that specific div

Recently, I've been tackling a project that requires me to manipulate classes in jQuery. Specifically, I need to change the class of a particular div and then perform a specific action targeting that div with another jQuery function. The issue I' ...

Is it possible to mix units within the 'path' element in SVG?

Utilizing SVG's rectangle element, you can specify dimensions as a percentage of its owner's dimensions and set a radius in pixels. By using the code below: <div style="position: relative;"> <object class="AIRound" t ...

Can you explain the difference between the <li> and <div> elements in HTML? How are they used differently

I'm currently exploring the elements for Selenium usage. I have a question about the <li> tag in HTML - could you explain its significance to me? Also, how does it differ from the <div> tag? ...

"Effortlessly move files with Filedrop HTML 5 and Jquery drag-and-drop feature

I am trying to implement a drag and drop file feature on my webpage, but for some reason, it's not working as expected. The drop zone is supposed to change its background color when I drag a file onto it, but that functionality doesn't seem to be ...

Tips for including input text in a select option dropdown menu

Can someone guide me on adding an input text box to a select dropdown in Javascript and utilizing it as a search filter? <select class="form-control"> <option value="trans">Trans</option> <option value="fund">Fund</opt ...

I am attempting to modify the class of a text field and display a feedback message when the input length falls between 1 and 20 characters, but I am unable to determine the cause of the issue preventing it from

In this code snippet, I am utilizing Bootstrap classes to change the design of an input field based on its length validity. Additionally, a feedback message is displayed accordingly. However, upon running the function, the input field does not reflect the ...

Relocate the preview division below the button in the Kartik File Input Widget

There are two input file buttons that allow users to upload an image on each button. Upon selecting an image, a preview of the image will be displayed above the button. The current layout is shown here: https://i.sstatic.net/aLAbo.png When images of diff ...

What is the method for adding the square root symbol to a button's value?

I am attempting to display the square root symbol inside a button, but I am having trouble making it work. Below is my button code: <input type="button" id="sqrt" value="sqrt" onclick="insert function here"> For the value, I want the square root sy ...