Exploring an illustration of Bootstrap

As a newcomer to html and css, I am currently working on building a website using the following example template: http://getbootstrap.com/docs/4.1/examples/dashboard/. My issue is that when I zoom in by pressing cmd + '+' or Ctrl + '+', the left sidebar disappears. I would like to prevent this from happening as I want to view the desktop version of the website on mobile screens as well. I suspect this may be related to the 'sticky' property in the dashboard.css file, but I am unsure of how to address it. To better understand the issue, you can access the dashboard.css and related files by inspecting the source code from the link provided above. Any guidance or suggestions would be greatly appreciated. Thank you!

Answer №1

One way to utilize the em unit in conjunction with media queries is as follows:

.responsive-container {
   width : 50px;
   height : 50px;
   margin : 0 auto;
    background-color: blue;
}

@media (max-width: 30em) {
  .responsive-container {
    background-color: red;
  }
}
<div class="responsive-container"></div>

Check it out on JSFiddle!

By setting a value of 30em, which equates to base font size(16px) * 30 = 480px;


If the width exceeds 519px, which is more than 30em (480px), then the media query will not be effective.

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


However, when the zoom font size is increased by 110% and the width is reduced to 461.278px, making it less than 30em (480px), the media query becomes active.

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


For more information on this topic, you may find the following link helpful:

Answer №2

Recommendation: Consider removing the fixed position and hidden display properties for mobile devices in the sidebar.

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

Arranging nested Divs for horizontal scrolling purposes

I'm struggling to achieve horizontal scrolling only in my provided example link HERE. It seems like a simple fix should be adding {overflow-x:auto; and overflow-y:hidden;} in the CSS, but I've tried that and it's not giving me the desired re ...

Navigate through the parent elements and show the text if the child element is not present

I'm currently exploring how to iterate through all parent classes (.grid) and if there is no child div with the class (.image-container), then to display the (.content-container) within the same (.grid) section. HTML: <style> .grid .content-co ...

Struggling with jQuery not updating class attributes for list items, any solutions to resolve this issue?

In order to have a unified navigator for various classes, I have stored it in a separate HTML file and am attempting to import it into the home page using jQuery. <!-- ======= Header ======= --><!-- End Header --> <div id="header-par ...

Can you explain how to incorporate a node module script into a React.js project?

I have encountered an issue where the element works perfectly fine when using an external node module, but fails to function properly when using a locally downloaded node module. Unfortunately, I am unable to identify the root cause of this problem. You c ...

Please refrain from initiating the next action until the previous action has been completed

As a beginner, I am currently working on a photo viewer project using JavaScript and jQuery. My main issue arises when clicking on the arrow to view the next picture. I want the current picture to fade out smoothly before the new one fades in. However, th ...

Issue with mime-type when uploading a file in a React js application on Windows operating system

In my React application, I have implemented the following HTML code to upload files: <div className="form-group files"> <label>Upload Your File </label> <input type="file" className="form-control" multiple onChange={this.onC ...

The functionality of scrolling ceases to work once the bootstrap modal is closed

I am utilizing Bootstrap v3.1.1 to showcase a modal popup on one of my web pages. The following code shows how I have implemented it. <!--Start show add student popup here --> <div class="modal fade" id="add-student" tabindex="-1" role="dialog" a ...

Animation using CSS that starts with a horizontal slide and transitions into a diagonal slide

Can I create an animation to move a graphic image on an html page from the middle of the screen to the top left corner? Here is what I have so far: #img1 {
 bottom: 50%;
 display: block;
 position: absolute;
 a ...

Achieving auto-height for two elements with CSS within a single block

I am attempting to combine two blocks into one fixed-height block in order to achieve the following design: ------------------------ UL (starts with height=0), expands when elements are added until maximum height is reached scroll bar should appear aft ...

Align the drop-down caret to the right using Bootstrap 4.1

I am currently using Bootstrap 4.1 and I have a Navbar that triggers a Modal Dialog Box with tabs and a drop down menu containing an image icon. My goal is to make the "caret" or down arrow of the drop down menu appear on the right side of the image. To a ...

Navigate to the middle of a DIV container in Angular 7

Is there a way to programmatically scroll to the center of my element on both the Y and X axes when a specific function is executed? My HTML structure includes the following (I am aiming to scroll to the middle of #viewport): </div> <div # ...

Arrange the elements within the anchor tag in a vertical line using Angular Material

Is there a way to style the elements within an anchor tag in Angular Material so that they display in a single line? I am looking for the CSS solution to achieve this outcome. This is my current HTML code: <a mat-list-item [routerLink]="['das ...

Issue with Bootstrap 4 validation allowing submission of invalid forms despite errors

I have a module that includes an Ajax form to add a user to a group based on their email (if the email exists in the database). The back-end is functioning properly and processes the data, while the front-end receives the response. However, I am experienc ...

When trying to run the code locally, JS and Bootstrap seem to have trouble functioning together, despite

Check out my codepen project here: https://codepen.io/ldrumsl/pen/ZxdZwa Below is the JavaScript code: $('#datetimepicker1').datetimepicker(); $('#datetimepicker2').datetimepicker(); Downloaded index.html file content: <!DOCTYPE ...

Nested divs with independent scrolling capabilities

I am interested in developing a gantt chart that displays days, months, and years at the top with tasks listed below. Here is my progress so far: https://i.stack.imgur.com/tr5y4.png In the image above, the scroll-x functionality works on everything incl ...

Customizing the appearance of arrows in a drop-down menu option

I've been working on a dropdown menu box and an arrow, and for the most part it's looking good. However, I've run into an issue with the arrow icon not changing color when the user is focused on it. I'm using the :focus pseudo-class to ...

What is the best way to ensure an element reaches its full height limit without triggering the need for page scrolling?

Can you help me with a dialog box issue I am facing? $(document).ready(function() { $('.ui.modal').modal('show'); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <link hr ...

react native ScrollView items with uniform padding at the top and bottom

I'm currently working on a scroll component that resembles a gallery of images. My goal is to center the images based on the device height with equal padding on both the top and bottom. However, I'm facing an issue where the top padding does not ...

Establish a Zebra DataList Chart

My first task is to connect a Table from the database so that each row is editable. After some research, I settled on using the DataList due to its <EditItemTemplate> property, which the repeater lacks. To create a Zebra table, I crafted a CSS class ...

Display Bootstrap 4 Modal in Laravel Using AJAX Request: Trigger modal when clicking with dynamic data

I have a modal that is called in a click event using the code below: $('.openBtn').on('click',function(){ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').at ...