Adjusting browser size causes CSS right sidebar to collide with page content

I've seen this question asked multiple times, but none of the solutions I came across have been effective for me.

My project involves using Bootstrap 3 with a fixed left sidebar, single column row page content, and a fixed right sidebar. While the left sidebar works as expected, the right sidebar doesn't respect the min-width setting of the page, causing it to overlap with the content (screenshots attached).

What I'm aiming for is to set a minimum width of 1024px for the page, where the content remains unchanged and the right sidebar stays in place without overlapping if the browser size drops below 1024px.

For now, I'm not focusing on responsive design as there will be a separate layout for smaller screens.

If anyone has a solution or suggestion for this issue, please share. Thank you!

Before Browser Resize >1024px: After Browser Resize <1024px:

CSS Code:

html,
body {
  height: 100%;
  min-width: 1024px !important;
  width: auto !important;
  width: 1024px;
  /* The html and body elements cannot have any padding or margin. */
}
#wrap {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  margin: 0 auto -70px;
}
#wrapper {
  padding-left: 75px;
  padding-right: 350px;
  transition: all 0.4s ease 0s;
}
#sidebar-wrapper {
  margin-left: -75px;
  left: 75px;
  width: 75px;
  background: #393839;
  position: fixed;
  height: 100%;
  overflow-y: hidden;
  z-index: 1000;
  transition: all 0.4s ease 0s;
}
#page-content-wrapper {
  min-width: 970px;
}
.sidebar-nav {
  position: absolute;
  top: 0;
  width: 75px;
  list-style: none;
  margin: 0;
  padding: 0;
}
#whobar-wrapper {
  margin-right: -350px;
  right: 350px;
  width: 350px;
  background: #393839;
  position: fixed;
  height: 100%;
  overflow-y: hidden;
  z-index: 1000;
  transition: all 0.4s ease 0s;
}
.whobar-nav {
  position: absolute;
  top: 0;
  width: 400px;
  list-style: none;
  margin: 0;
  padding: 0;
}

HTML Code:

<div id="wrapper">
  <div id="sidebar-wrapper">
    <ul class="sidebar-nav">
      <li>
        <a href="#" class="sidebar_sheet sidebar_sheet-profile" title="My Profile"></a>
      </li>
      <li>
        <a href="#" class="sidebar_sheet sidebar_sheet-contacts" title="Contacts"></a>
      </li>
      <li>
        <a href="#" class="sidebar_sheet sidebar_sheet-shortlist" title="Shortlist"></a>
      </li>
      <li>
        <a href="#" class="sidebar_sheet sidebar_sheet-explore" title="Explore"></a>
      </li>
    </ul>
  </div>
  <div id="whobar-wrapper">
    <!--    <ul class="whobar-nav">-->
    <!--        <li><a href="#" class="sidebar_sheet sidebar_sheet-profile" title="My Profile"></a></li>-->
    <!--        <li><a href="#" class="sidebar_sheet sidebar_sheet-contacts" title="Contacts"></a></li>-->
    <!--        <li><a href="#" class="sidebar_sheet sidebar_sheet-shortlist" title="Shortlist"></a></li>-->
    <!--        <li><a href="#" class="sidebar_sheet sidebar_sheet-explore" title="Explore"></a></li>-->
    <!--    </ul>-->
  </div>
  <div id="page-content-wrapper">
    <div class="page-content">
      <div class="container-fluid">
        <div class="row">
          <h1>Temporary Dashboard Header</h1>
          <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae
            est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci,
            sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt
            quis, accumsan porttitor, facilisis luctus, metus</p>
        </div>
      </div>
    </div>
  </div>
</div>

Answer №1

Upon reviewing your CSS code, I noticed that you have fixed widths set which can limit flexibility when resizing the screen. To achieve a responsive design with three columns, consider changing the pixel values to percentages for fluid columns or utilize @media queries.

Check out this resource on @media queries: http://www.w3schools.com/cssref/css3_pr_mediaquery.asp

@media screen and (max-width: 1024px) {
     .........
}

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

Investigate the CSS display property of an element using JavaScript

Can JavaScript be used to determine if an element's CSS display == block or none? ...

"Troubleshooting: Issue with array_shift() function unable to identify

My latest project involved creating a Web App for a Delivery service that utilized Google Maps and queried a database for open deliveries. However, I encountered an issue when attempting to use array_shift() on the delivery array through an ajax call - the ...

When the field is clicked into for the second time, the month and year picker values will update

I recently implemented a month and year date picker code I found on a website. While I was able to customize the date format (mm/dd/yy) and successfully select values, I encountered an issue where the selected date changes drastically when clicking away fr ...

How can I enlarge an image on hover without disrupting the surrounding content?

After following the instructions provided on how to change image size during mouse hover, I encountered an issue where the resized image caused the rest of the content on the page to shift. Does anyone have suggestions on how to resolve this problem? ...

Form for sending an AJAX request

Take a look at my website and the corresponding source code. You will find a "Form" on the page. Once a user submits the form, the server responds using the file "submit.php". This functionality can be tested online. I am attempting to retrieve this serve ...

Optimizing table cell width in ASP.NET based on longest text content

Software: Visual Studio 2010, Asp.Net 4.0 I am working with multiple tables that are stacked vertically on top of each other, all generated dynamically in the codebehind. I would like to ensure that the first column in each table is the same width, based ...

Is it possible for JavaScript to update the Bootstrap modal dialog?

As a beginner in using Bootstrap, I have encountered an issue where I am unable to update the textbox within the modal before the user triggers the dialog. Despite trying various methods like JavaScript and C# on the server-side, none of them seem to succe ...

Multiline text that appears inline

Is there a way to achieve this output in HTML or using CSS? This is the text: A very long piece of content that wraps automatically onto multiple lines Take note of how the text wraps and aligns on the left side. I am aware that tables can be used for t ...

Is it possible to utilize html5 cache manifest in an android webview?

Chrome desktop is displaying a warning message on the console regarding the deprecation and end of support for using a manifest appcache: [Deprecation] Application Cache API manifest selection is deprecated and scheduled for removal in M82, approximat ...

Using JavaScript to Align HTML Data to the Right or Left

I have successfully created an HTML table from JSON data and formatted it using JavaScript as required. However, I am facing a challenge with right-aligning all the amounts coming from my JSON data. I want all the numbers to be aligned to the right but I& ...

Exploring alternative options to replace PEAR's HTML_Table

I am encountering difficulties while using PEAR HTML_Table (strict error, bug still unresolved). I am seeking a standardized method to generate HTML output that creates a table from associative arrays. The key should be in col#1 and the value in col#2. If ...

What is the process for incorporating a custom data attribute into the serialization parameters in Gridster.js?

I am currently utilizing Gridster.js in conjunction with JQuery for the purpose of creating a widget container. My goal is to utilize the serialized_params property of Gridster.js to store additional attributes (such as owner and company) of the added widg ...

The width attribute is not being applied in Internet Explorer's compatibility modes

When I try to apply the following CSS, the width does not get applied in IE Compatibility modes: .multipleShipmentsGrid { border-color:#949EAA; border-style:solid; border-width:1px; width:80%!important; border-collapse:collapse; } How ...

The navigation bar is not displaying properly due to the PHP echo command

Struggling with an unfamiliar problem here. Everything functions well when using regular HTML code, but the navigation bar appears abnormal when utilizing a php-echo. The desired look of the bar (with normal HTML CODE): However, with php-echo it resembl ...

execute the function of the recently added button

There is a button with the id "openWindow" that opens a window when clicked. <button id="openWindow">Open Window on Click</button> A jQuery code changes the button id to "closeWindow" and sends an alert message saying "Open." $( "#openWindow ...

Entering in full screen mode

Is there a way to create a first screen appearance that spans the entire screen? I want the whole page to be fullscreen and when someone scrolls down, it transitions to a new screen. I am struggling to find a solution for this. body { margin: 0 0 0 0; ...

`Nginx with a touch of material design`

Currently, I'm in the process of implementing material design UI on a functioning web application. The application utilizes Nginx, PHP, and PostgreSQL. While I have proficiency in PHP and PostgreSQL to ensure the functionality (code composed in notepa ...

I'm currently in the process of creating a Firefox extension and my goal is to accurately count the total number of text boxes on a webpage while excluding any hidden text boxes. Can someone please

As I work on creating a Firefox extension, I am faced with the task of counting the total number of visible text boxes on a webpage while ignoring any hidden ones. Many webpages contain hidden text fields for future use, so my goal is to exclude these fr ...

What is the best way to retrieve user groups in Django?

My goal is to investigate the user groups associated with a user in Django. However, when I check the console, I encounter the message: Uncaught ReferenceError: user is not defined at 6/:643:33 The purpose of the function is to redirect the user based ...

Anchor from HTML/Javascript to different section is not functioning as expected

I am having trouble with creating a 'scroll down' link on my webpage. I cannot seem to find a solution specific to my issue. My code looks like this: <a href="#apply-profile">scroll down</a> When clicked, this link should take users ...