Expand the div to fit one side of the browser

My bootstrap code looks like this:

<div class="container">
  <div class="row">
   <div class="col-md-8">content</div>
   <div class="col-md-4">
     <div class="map">map goes here</div>
   </div> 
 </div>
</div>

The .container is centered and not full width. I am trying to make the .map div stretch all the way to the right border of the browser window. Any suggestions on how to achieve this?

Answer №1

You can find the solution to your query on the official Bootstrap documentation main page.

To create a full-width container that stretches across the entire viewport, use the .container-fluid class.

<div class="container-fluid">
  ...
</div>

Answer №2

To achieve the desired effect, you'll have to apply a custom style on the .container class in addition to the default bootstrap styling:

body .container {
    margin: 0 auto 0 0;
}

Answer №3

Actually, the solution I'm looking for is a bit different. I want the container to be fixed at 1170px width on medium screens, but I need the .map element to extend beyond the container and reach the right side of the browser.

I'm starting to think achieving this effect might require more than just CSS. Perhaps JavaScript could assist?

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

I'm having trouble with jQuery recognizing the left-margin property. Is there a workaround for this issue?

I rarely use jquery, but I wanted to add animation to a side bar. The sidebar menu is 670px with a -670 left-margin. When the user hovers over it, I'd like the left-margin to change to 0px and reveal the hidden content. Upon mouseout, it should return ...

What is the best way to incorporate the <input> tag within an additional div in a bootstrap 4 form displayed inline?

Picture this straightforward form: <div class="d-flex justify-content-center" style="direction: ltr"> <form class="form-inline flex-fill"> <div class="input-group input-group-lg flex-fill mx-3"> ...

Is there a way to change the URL in the address bar without refreshing the page?

Is it possible to update the URL in the address bar without reloading the page? I came across 2 potential solutions: Option 1: Check out this link It involves using window.history.replaceState. But when I tried implementing it in my angularjs projec ...

No departure animation employed - Polymer

I am working on a project that involves animating a paper-icon-button with spin and opacity effects when hovering over an image using the on-mouseenter and on-mouseleave events. Everything works smoothly when hovering over the image, but I am facing an is ...

When viewing on mobile devices, the hover effect in responsive web design

While working on a responsive website, I encountered some challenges. I have a Div containing an image and some information. When a user hovers over this div, the background changes and 3 buttons appear. However, the issue arises when using a mobile devi ...

Generating a new display div element using an anchor link

I've set up a div container with a button that, upon clicking, adds a class to an element in my markup causing it to expand and take over the entire screen. Markup before: <section class="isi" data-trigger="toggle" data-trigger-class="isi--show-i ...

Elements that are positioned in a single line in a text

I am experimenting with a layout where each item is displayed in a single line, with the width of the items determined by their content. The desired output looks like this: Intended result: (This feature is only supported in modern browsers) .item { ...

Adjust the dropdown width on a bootstrap form to match the size of the textbox

In order to maintain a combined width of 450px, I have two textboxes. One textbox includes a dropdown menu while the other does not. Both textboxes are part of an input group. The dropdown can switch between either textbox at any time. I need the width ...

JQuery .click Event doesn't center elements even with transform-origin adjustment

In the JSfiddle provided below, you can see that after a click event occurs, two span (block) elements rotate 45deg to form an "X". However, both elements are slightly shifted left, creating an off-center "X" relative to the parent's true center-origi ...

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 ...

How can one effectively manage a dynamic web element ID and xpath as they evolve?

After generating an XPath for a dynamic web element, I came across two nodes that are strikingly similar. The XPath used is: //*[contains(@id, "gwt-uid-")]/span[2]. Despite my best efforts to distinguish between the two nodes, I have not been successful. A ...

Using base64 encoding for font-face with alternative fallbacks

After reading this article, I am interested in incorporating a font face in the following way: @font-face { font-family: 'MyWebFont'; src: url('webfont.eot'); src: url('webfont.eot?#iefix') format('embedded-openty ...

showing information on webpage 2 received via query parameters from webpage 1

Hello, I am trying to input text into a textarea and then send the data through a query string to another webpage. My goal is to display the data on the second webpage. I have written the following code, but it doesn't seem to be working. I've ch ...

The functionality of z-index is not applying when using position fixed

I have the following CSS code: #one{ position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 999; } #two{ position: relative; z-index: 9; width: 200px; height: 200px; background: red; } #link { position: ...

Extracting the inner content in the absence of an HTML element, only plain text

My website's platform has some unusual HTML that I need to work with. There is a section of code that looks like this: <div class="report-description-text"> <h5>Description</h5> Welcome to Ushahidi. Please replace this report with a ...

Tips for changing the state of a toggle button with JavaScript

I need help creating a toggle button. To see the code I'm working on, click here. In my JavaScript code, I am reading the value of a 'checkbox'. If the value is true, I add another div with a close button. When the close button is clicked, ...

Adjust the height and eliminate gaps between rotated divisions

I'm currently working on a floating menu that includes several links. I've successfully applied a CSS style to rotate the menu vertically (-90deg), but I'm facing an issue with the height being greater than desired. How can I reduce the heig ...

What steps should I take to change the orientation of these items from vertical to horizontal display?

I'm struggling to get these items to appear horizontally (side by side) instead of vertically on my webpage. They are linked to a database, hence the PHP code included here. If you need more information, please feel free to ask. body { font: no ...

Identifying the moment when attention shifts away from an element

Is it possible to detect when focus occurs outside an element without relying on global selectors like $(document), $(body), or $(window) for performance reasons? If achieving this without global selectors is not feasible, provide a provable reason expla ...

Interactive Bootstrap Popover Information

I am currently working on a link that toggles a Bootstrap Popover: <a href="#" data-toggle="popover" title="List of Stuff" data-rights="${result.itemId}">Toggle Popover</a> The challenge I am facing is related to displaying a list of countrie ...