Troubleshooting: Bootstrap 4 CSS causing Chrome's print layout to vanish

My goal is to give users of my website the ability to print pages in either portrait or landscape mode.

While attempting to print from Google Chrome with Bootstrap 3.3.7, I noticed that the Chrome print settings included a Layout option. However, after updating the css/js to version 4.0.0, this Layout option no longer appeared. I believe this change may be related to one of the following CSS directives:

@page
@media

Answer №1

To resolve the issue, I implemented the following CSS code:

@page {
    size: auto;
}

Answer №2

The following code snippet was functional in Bootstrap 4.5 without the need for using semicolons:

@media print { @page {size: auto !important} }

Answer №3

For Bootstrap 4.4, it is necessary to define the following:

size: auto !important;

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 am attempting to display a JSON array in an angular application

How can I display a JSON Array on the UI using AngularJS? I have the JSON array in the controller, and I'm attempting to retrieve it in the view. Below is the code snippet of what I have implemented. Please provide feedback on whether my approach is ...

The Bootstrap hamburger menu icon (3 horizontal bars) fails to display when the browser is resized

The issue I'm facing is that the three-bar "hamburger menu" doesn't appear when I resize the browser. While the collapsed menu is functional upon clicking, it's essentially an invisible white box. I've meticulously compared my code to B ...

Implementing dynamic CSS in AngularJS using conditional statements

One technique I've been using in angularjs involves toggling between two windows using the ng-click and ng-show directives: <div ng-init="showTab2 = false"> <a ng-click="showTab2 = true; showTab1 = false ">#Tab1 </a> ...

Alignment issue: table-cell elements are not lining up correctly

Curious as to why the containers on this page seem misaligned. Any assistance would be greatly appreciated. Thank you. http://codepen.io/anon/pen/jpmtz ...

Navigating through multiple overlapping scenes in Three.js using Orbit Controls

Seeking assistance with a dilemma involving the use of Orbit Controls with Multiple Overlapping Scenes. To showcase the issue, I made adjustments to the example found at multiple scenes and developed a test specific to my needs. The code can be accessed h ...

The props are not receiving the margin property

I am working on a styled component that needs to receive a prop to determine if it should have a margin on the left or right. It seems that there is a syntax issue that I am struggling with. Here is the code snippet: const FormDiv = styled.div` displa ...

Vue: the placeholder option in the select input is no longer visible once v-model is added

<select class="cursoruser-pointer p-2 w-full rounded-full "> <option class="rounded-full " disabled selected value="">Language to learn</option> <option class="rounded-ful ...

When using headless mode in Selenium with Python, Chrome and Firefox will open PDF files in a new tab without saving them

While running a test in headless chrome, I encountered an issue where a PDF file would open in a new tab instead of downloading when clicking on a button. Interestingly, the test runs smoothly in NON-headless mode. To tackle this problem, I tried implement ...

Ways to conceal Bootstrap-designed elements behind a fullscreen overlay

I'm attempting to create a transparent layer to conceal the entire content of my page behind it. It works fine without the Bootstrap columns, but as soon as I add the columns for responsive design, it stops working (or maybe I'm just not understa ...

Tips for showcasing several thumbnails simultaneously as you upload images on a webpage with HTML and JavaScript

function displayImage(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { $('#selectedImage') .attr('src', e.target.result) }; reader.read ...

Can one utilize Javascript to write in plain text format?

Currently, using JavaScript I have a plain text containing data that is displayed within my form tags. Everything is functioning correctly, but now I need to update the values inside the code of my form tags in order for the changes to also be reflected in ...

What is the best way to widen each tab so they fill up the entire width of the content block?

As a newcomer to both programming and this website, I've been exploring various codes for creating vertical and horizontal tabs. I have a specific query about this particular example found at https://jsfiddle.net/eu81273/812ehkyf/: My goal is to adju ...

Trouble with PHP and HTML Code not functioning properly after loop execution

I created a form with a dropdown menu that pulls options from a MYSQL Database. However, after fetching the options, the button and other components of the code seem to disappear. Everything else works fine when I comment out the PHP Query. <form acti ...

An error-free blank page in Three.JS with a CSS3DRenderer

After implementing the CSS3DRenderer in my code, I am encountering a blank page without any errors. My main focus is to draw a line using the CSS3DRenderer as the rest of my code relies on its functionality. Here is the HTML code snippet: <!DOCTYPE htm ...

Adjust the text size in a collapsible tree based on the number of expanded components inside the container

Hi there, I'm currently developing a code for an expandable/collapsible tree using checkboxes. I have successfully implemented the basic functionality, but I have a specific requirement. I want the text size to decrease as the tree expands to prevent ...

Unable to reveal hidden text with invisible formatting (font-size: 0)

I have a Joomla 3 website where I created a blog using a design-controll template. I made a "new-article" page but realized that some buttons were missing text. Upon inspecting with Firebug, I found that there was a font-size:0 property causing this issue. ...

Persistent Footer - Attemping to keep footer anchored to the bottom of the page

Today, I am facing a sticky footer issue that is rather frustrating for me. Despite trying various resources and conducting thorough searches, I am unable to identify what is causing the problem with my footer. I would greatly appreciate any help in resolv ...

Controlling the Alignment of HTML Div Elements

I'm struggling to align some of these divs, especially centering them. I want the page to closely resemble this image: Here are the specific requirements: 1) The header text should be centered vertically and placed in a separate div with a black back ...

Code for Rotating the Wheel - MINUS javascript

Exploring the possibility of creating a spin the wheel effect like this using only HTML and CSS, no Javascript involved Seeking references or examples to determine feasibility. ...

The HTML code does not seem to be acknowledging the CakePHP link

When using Cakephp to generate a link with Html->link, the code looks like this: echo $this->Html->link('Download',array( 'plugin'=> 'galleries', 'controller'=> 'galleries', 'a ...