The medium breakpoint is utilized in Bootstrap 4 for printing purposes

Recently, I made updates to some pages to enhance their mobile friendliness. However, we encountered an issue where some users are printing the pages using tablet styles instead of desktop styles, regardless of whether they are in portrait or landscape mode and using Firefox or Chrome.

I am looking for a way to ensure that the pages print with the large breakpoint, but so far I haven't been able to figure it out.

Even though I have already set the following:

@media print {
    body {
        min-width: 992px !important;
    }
}

Desktop sample

Print sample

Here is a sample jsfiddle:

https://jsfiddle.net/jz56frqh/2/show

Answer №1

To adjust the print sizing in Bootstrap, you can modify variables in the variables.scss file:

$print-page-size:                   a3 !default;
$print-body-min-width:              map-get($grid-breakpoints, "lg") !default;

If you prefer to customize it manually in your CSS, you can use the following code snippet (remember to change min-width to your preferred size):

@media print {
  body {
    margin: 0;
    padding: 0 !important;
    min-width: 768px;
  }
  .container {
    width: auto;
    min-width: 750px;
  }
}

For more information on these variables, check out this link: https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss

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

Failure to receive results from $.getJSON request

I am currently working on developing a web page that allows users to search and retrieve Wikipedia pages based on their search results. Below is the relevant HTML code for the search feature: <form class='search-form' onsubmit='return f ...

What is the best way to deactivate buttons with AngularJS?

I have a situation where I need to disable the save button in one function and permanently disable both the save as draft and save buttons in another function using AngularJS. How can I accomplish this task with the disable functionality in AngularJS? Her ...

Retrieve information from the database upon clicking the submit button

My table is not getting data from the database when I click a button. I tried using this code but it returned an error. <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col ...

Tips for including a permanent button at the bottom of a material ui dialog box

I want to implement a dialog popup in my react js application. When the user clicks on a button, the dialog should open up. Inside the dialog, there is a form with input fields. After the user fills out all the inputs, they can submit the information by cl ...

Ways to obtain the complete file path through JQUERY for an uploaded file when utilizing <input type="file"> across all browsers and the explanation behind why IE and Chrome return "c:/fakepath/filename"

CHECK OUT THE JSFIDDLE CODE HERE This code utilizes the <input type="file> element to allow users to browse and select a file, with the aim of obtaining the full path. The HTML: <input class="file_upfile" type="file" /> <input class="btn_ ...

Mobile displays showing truncated text that is hidden until hovered over

I am seeking guidance on how to display truncated text in an Angular app on mobile devices... td { word-break: break-all; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; } td:hover{ overflow: visible; white-space: n ...

The div in tailwind/css does not expand as expected

I am facing an issue where the light blue div is not taking up the entire screen space as intended. In addition, the dark blue div is visible even when there is no content in it, while the light blue one remains hidden despite setting max-height (I also tr ...

Develop fresh JavaScript code using JavaScript

Is it possible to dynamically create a new row in an HTML table by clicking on a button? Each row contains multiple input fields. <script type="text/javascript> row = 2; specific_row_id = new Array(); $(document).ready(function() { $(".change_1 ...

Display Navigation upon clicking a designated button

Seeking a way to automatically navigate to the second tab after submitting content in the first tab using nav-link. <ul class="nav nav-tabs" id="myTab" role="tablist"> <li class="nav-item"> <a class="nav-link active" id="home-tab" dat ...

Interactive mobile navigation featuring clickable elements within dropdown menus

I recently implemented a mobile nav menu based on instructions from a YouTube tutorial that I found here. Everything was working perfectly until I encountered an issue on the 'reviews list' page. The dropdown in the mobile nav is supposed to be ...

Is there a way to emphasize a particular day on the calendar obtained from the URL?

I have implemented FullCalendar functionality to enable users to select a specific date, retrieve data from a database, and then reload the page with that data. The page is updated with the selected date in the URL. However, when the page reloads, althoug ...

When viewing HTML "Div" on smaller screens, the full height may not be displayed properly

My setup includes two monitors: one is 24" and the other is my laptop's 12.5" screen. I have a red box (div) in my web application that displays full height on the larger monitor, but only partially on the smaller one. I'm puzzled as to why it s ...

How can I ensure that changes made to a div in ASP.NET remain persistent during postback?

My current setup involves using jquery to toggle a div on and off successfully. However, I am encountering an issue where any changes made are not saved when a postback occurs on the page. Can anyone provide guidance on how to save these changes? Any assis ...

The alignment of list bullets is inconsistent across different web browsers

Check out this code snippet on JSFiddle: http://jsfiddle.net/PZgn8/8/. It's interesting to see how the rendering differs between Chrome 27 and Firefox 21. Despite the difference, I believe Firefox is actually displaying the desired outcome. <ul st ...

Exploring reviews with an innovative combination of Node.js and MongoDB

Recently diving into the world of Nodejs and mongoDB, I am excited to create two distinctive pages: one for users to update their account details such as profile picture, email, and name - all of which would be saved into the database; and another for re ...

Enabling or Disabling Inputs in Angular

I'm looking to customize my form behavior in a specific way - when I click on the modify button, I want only one line to be modified instead of all three. How can I achieve this? Images : edit save app.component.html : <table mat-table [dataSourc ...

What is the best method for locating X-Path for elements inside a frameset?

I need help creating a test case for Selenium because I am struggling to locate elements on my website. The issue seems to be related to the fact that my site uses an HTML frame set. When I try to select all links using Firebug: //a I do not get any res ...

Ensure that the click event is triggered only once for each distinct class

Is there a way to make a click event trigger on any element with the same class just once? I attempted using '.one', however, it removes itself after the first element with the class is clicked. $(document).ready(function() { $(".dro ...

Is there a way for me to make the two form fields expand and fill the gap between them?

I've created a form with the first name and last name fields displayed horizontally next to each other, as shown in the image. When a user clicks on a field, it should change color (still pending coding). However, there seems to be an unwanted gap be ...

Positioning elements vertically and float them to the left side

I'm struggling to grasp the concept of the float attribute. Here's the code that is causing me confusion: #p1 { border: solid black 3px } <p id="p1" style="float:left">Paragraph 1</p> <a href="https://facebook.com" style="floa ...