Div displaying white blank space due to Internet Explorer 11 issue

While working on creating a print-friendly version of a webpage, I encountered a puzzling issue with Internet Explorer 11. Both the webpage itself and the print preview are showing some unexplained blank space below the div elements.

I have meticulously checked all the CSS classes, html markup, and other possible causes for this problem.

  • Adjusting the height does not resolve the issue
  • Setting margin and padding to 0 also has no effect

There seems to be a large white block appearing beneath each div element without any apparent reason, leaving me baffled by why IE is inserting it there.

Here is an example snippet of the code:

<div class="row"> ## This div shows excessive white space below it
 <div class="medium-12 columns"> ## This div renders fine
  <!-- content -->
 </div>
</div>
## EXCESS WHITE SPACE HERE ##
## Approximately 20-30 lines long ##
<!-- Next div starts here -->

Below are the CSS rules applied to the affected tag:

padding: 0 0 5px 0;
page-break-inside: avoid;
margin: 0 -.9375rem;
max-width: none;
width: none;
overflow: hidden;

If anyone has insights or suggestions on what could be causing this issue, I would greatly appreciate your input.

Answer №1

I noticed that you attempted to reset the margins to zero, but I recommend incorporating a stylesheet reset as well. CSS resets remove default browser styles that may interfere with custom stylesheets and document formatting.

You can easily add a CSS reset by linking a separate file in your document or by integrating the code at the beginning of your main CSS file before any custom styles.

There are various CSS reset options available, but in my opinion, Mr. Meyer's reset is the most effective choice for this situation.

Answer №2

Revised:

Upon reviewing your usage of Foundation, it appears that there may be an issue with applying negative margin values in the foundation grid system, such as margin: 0 -0.9375rem;

The value 0.9375 represents the primary margin for your grid, generated from SCSS to CSS. To prevent additional overlapping margins within nested columns, Foundation utilizes a negative padding adjustment.

If you encounter challenges with nested rows, ensure each sub .row is enclosed within a "small-xx ... columns" class to normalize the edges.

Avoid this scenario:

<div class="row">
  <div class="small-6 columns"></div>
  <div class="row">
    <div class="small-3 columns"></div>
    <div class="small-3 columns"></div>
  </div><!-- .row -->
</div><!-- .row -->

Instead, follow this structure:

<div class="row">
  <div class="small-6 columns"></div>
  <div class="small-6 columns">
    <div class="row">
      <div class="small-6 columns"></div>
      <div class="small-6 columns"></div>
    </div><!-- .row -->
  </div><!-- .small-6 .columns -->
</div><!-- .row -->

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

Steps for developing a web-based interface for my software

I could use some guidance on how and where to get started. Currently, I have a program written in vb.net that performs basic functions by executing bat files, accessing specific folders, and carrying out command line tasks. My plan is to convert this progr ...

The issue with the before selector causing the button label to overlap on top of the button remains

Check out the code snippet When hovering over the button, the "Sign Up!" label disappears. I tried adding color: rgba(32,32,32,1); to both the .button element and the ::before selector as a backup, but the label still won't display on top of the butt ...

`Take action on a row by selecting the Edit option in CodeIgniter`

In my table, I have data displayed with an edit button in each row. What I want is for a pop-up or lightbox to appear when the edit button is clicked, without refreshing the page, and display all fields within that box. I am familiar with updating in the c ...

Transferring data from an Excel spreadsheet into a structured table

I am interested in transferring specific columns of data from an excel sheet to an HTML table. My goal is to populate the table based on certain conditions rather than statically inputting fixed cells. For instance, if my excel sheet has columns for Name ...

How to disable the underline styling for autocomplete in a React Material UI component

Seeking assistance with removing underline styling and changing text color upon focus within the autocomplete component of React Material UI. Struggling to locate the specific style needing modification. Appreciate any help in advance! ...

Tips on Creating a Responsive Absolutely Positioned Div for Various Screen Sizes

I'm currently working on a website and I've come across an issue regarding the responsiveness of an absolutely positioned div across various screen sizes. Let me provide some context and share what I have attempted so far: Issue: Within the head ...

How to control the audio currentTime using Angular 2 component

Here is the HTML code snippet that creates an HTML5 audio element: <audio id ="audio2" controls="controls" autoplay="false" (canplay)="CanPlay($event)"> <source src="http://localhost:51657/Audio/1" type="audio/mp3"> </audio> In the ...

When there are multiple elements within the parent container, the CSS hover margin-top alteration fails to take effect

I am currently working on creating a dynamic menu bar that has elements which smoothly move upwards on hover. However, I have encountered an issue where this movement effect only works when the parent container contains exactly one element (such as in titl ...

Is Firefox the only browser where the webpage is displayed off-center?

I've encountered a strange issue with my website that I can't seem to figure out. Despite searching extensively on Google and Stackoverflow, I haven't come across anyone else facing the same problem. During testing in different browsers lik ...

The image fails to display when using THREE.js and Panolens.js

Trying to create a 360-degree environment with informational buttons using THREE.js and Panolens.JS However, I'm unable to resolve why the image is not appearing. Continuously encountering the error: Uncaught ReferenceError: process is not defined. ...

Ensuring the model accurately reflects the input's value attribute in AngularJS

I am in the process of creating a set of image "radio buttons" where only one can be selected per group. However, as a newcomer to Angular, I'm facing difficulties in maintaining the value and using it as my ng-model. Additionally, I am looking for a ...

Building a set of multiple choice questions with the flexibility to include two or more options using bootstrap

If you visit https://getbootstrap.com/docs/4.0/components/forms/, you can find code that allows you to create a multiple-choice question with only one choice allowed using the following snippet: <div class="form-check"> <input clas ...

How can I ensure text remains confined within the parent div when working with Bootstrap?

I'm having trouble keeping the text and links within their parent div. Even though I set the outer boundary as col-sm-8, the text and links are overflowing. I'm not sure what I'm doing wrong, but the code I am using is shown below. I have a ...

Ensuring an element matches the height of its child using CSS styling

How can I ensure that the parent element's height adjusts to match the height of its child element using CSS? <div class = "parent"> <div class="child"> </div> </div> ...

The timing of the RequestAnimationFrame function varies based on the dimensions of my canvas

In my application, I have a canvas that dynamically adjusts its CSS size based on the window size. The main gameplay loop in my code looks like this: run = function(){ console.log(timerDiff(frameTime)); game.inputManage(); game.logics(); ...

Stopping a jQuery function from executing multiple times while it is already active - is it possible?

Currently, I am utilizing the http://jsfiddle.net/CqAU2/ plugin for image rotation on my website. The issue I am facing is that when the user clicks on the image box multiple times, it continues rotating each time. I want the click action to only be regi ...

Display an image using a modal window and Ajax XMLHttpRequest

I was tasked with creating a button that can load various types of content (text, images, videos, etc) into a modal popup window using Ajax without any frameworks. So far, I've been successful with text but have run into issues with loading images. De ...

What's causing this javascript to malfunction on the browser?

I encountered a problem with the code in my .js file. Here is a snippet of the code: $.extend(KhanUtil, { // This function takes a number and returns its sign customSign: function(num){ num = parseFloat(num) if (num>=0){return 1} ...

Transform the radio selection into physical buttons with the Ruby on Rails Simple Form Gem

I've been struggling to achieve the desired layout when using the automatic wrappers generated by the Simple Form gem. I am working with Ruby on Rails and the Simple Form Gem, trying to create radio buttons with a specific design: https://i.sstatic.n ...

Obtain JSON information by submitting an HTML form using an HTTP POST request

Looking to retrieve JSON data with the click of a button Here's the HTML code: <html> <title> </title> <body> <h2> Main API - http://api.kalendern.se/api</h3> <form method="get" enctype="applica ...