The CSS table layout functions properly in Chrome but is not compatible with IE9

I am facing an issue with a layout example that works fine except in IE. The problem arises when I try to toggle the size between 50px and 100px on the bottom div upon clicking a button.

Even though I attempted to create a fiddle, I was unsuccessful.

<style type="text/css">
    .table
    {
        display: table;
        width: 100%;
        height: 100%;
    }

    .bottom
    {
        display: table-row;
        height: 100px;
        background-color: red;
    }

    .top
    {
        display: table-row;
        height: 100%;
        background-color: yellow;
        position: relative;
    }

    .header
    {
         height: 100px;
         background-color : gray;
    }

    .content
    {
        display: table-row;
        height: 100%;
        background-color: yellow;
        position: relative;
    }

    .footer
    {
        display: table-row;
        height: 100px;
        background-color: blue;
    }

</style>
<div style="position: absolute; top: 0; right: 0; bottom: 0; left: 0;">
<div class="table">
    <div class="top">
        <div class="table">
            <div class="header" >
                header
            </div>
             <div class="content">
                1.1
            </div>
            <div class="footer">
                1.2
            </div>
        </div>
    </div>
    <div class="bottom">
    <!-- Can change bottom height to 50px on click -->
        <button id="changeSize"></button>
    </div>
</div>
</div>

Answer №1

The code above is fully functional in a jsfiddle: http://jsfiddle.net/c8nLb/1/

From my understanding, it operates well in IE(9).

I observed the element with the class "bottom" and converted it to an ID (getElementsByClassName IE resolution issue)

In addition, I transferred the height attribute from the main CSS styling block to an inline style due to difficulties in applying the height style with Javascript.

Hoping it functions seamlessly for you as well!

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

What is causing this PyScript code to malfunction?

While working on a school project to create a PyScript calculator program, I encountered a situation where the script stopped functioning correctly. Strangely, I had to resort to using the alpha version of PyScript in order to make a functional calculator. ...

Ways to prevent a specific class from using CSS styling

My HTML <body> <div id="finalparent"> <!--many parent divs here--> <div id="1stparent"> <div id="txt_blog_editor" class="box" style="width: 1097px;"> <div class="abc anotherclass"> </div> & ...

The content is being moved following the jQuery fadeIn transition

I created a jQuery slider for a client's demo site. (Demo: ) After the text (which is actually an image) fades in over the orange background, it moves about 20 pixels to the left and down. Can anyone explain why this is happening? ...

Is the ng-model feature not functioning as anticipated?

Within my AngularJS application, I have a textbox connected with the directive ng-model=sampleValue. My goal is to change the value of the textbox to "Harish" whenever I click on a button that triggers the show function. However, I am encountering issues ...

What is the process for showing a duplicate image in a dialog box once it has been selected on an HTML page?

I am experiencing an issue where the dialog box is displaying when I use the button tag, but not when I use the image tag. Can someone please assist? <img src='image.png' height='200px' widht='200px' id='1'> ...

Using JavaScript to we can transfer the function result to an HTML input field

Is there a way to display the result of a JavaScript function in an HTML input field? Here is an example form: https://i.sstatic.net/HHHl2.png When I click "Run - Script," the following simple script is executed: <button type="submit" class="btn btn ...

What is the best way to trigger ajax when the user clicks the back button to return to the previous webpage?

Check out my code snippet below: HTML Code <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div class="body"> <div class="dropdown_div"> <select id="q_type" class="dropdown" ...

Using Selenium in Python, loop through webpages to extract the search result position

Currently, I am using a script to search for a generic keyword and determine the rank of my products on an e-commerce platform. The code below has been working successfully in fetching the product ranks on the first page. from selenium import webdriver dr ...

Surprising sight of a blank canvas behind the font-awesome icon

Is there a way to remove the unexpected white background that appears when adding a font-awesome icon? Here is the HTML code: <div class="notifications-window" id="close-notifications"> <div class="notifications-header&qu ...

Ensure that a v-card in Vuetify/Vue 2 is consistently square in shape, yet capable of adjusting its size dynamically

I am facing an issue where I am trying to make sure a v-card always maintains a square shape (or any other aspect ratio set), even if it means there is scrolling or cut-off text/components inside the card. For example, I want this v-card with lorem ipsum ...

opting for a versatile grid system design / layout framework

Hi there, I've been doing some research on fluid grids and responsive grid frameworks online. I'm a bit confused about whether I should use a fluid or responsive grid, and if anyone here can help me with some usable code examples, it would be gre ...

Is there a way to consistently maintain a specific column size in Bootstrap?

I'm currently working on a website and running into an issue that I can't seem to resolve. The problem lies in the layout of multiple cards with information; they are arranged in columns and when there are more than 4 columns, they switch to a ne ...

Achieving Vertical Alignment in a Bootstrap 4 Image Overlay Card

I am facing a challenge in trying to vertically center a FontAwesome icon within an Image Overlay Card. Despite attempting various methods like using d-flex and justify-content-center, none of them seem to be effective. What could I be overlooking? < ...

Display the output of awk on a single line for specific columns

Here is a file called "test" that displays the following information: vserver share-name path acl TEST_SERVER TEST_SHARE_PATH /TEST/TESTSHAREPATH "test\testuser / Read","test\testuser1_R / Read","test\testuser2_RW / Change ...

In order to avoid conflicts, please update the version code of your APK as there is currently one with version code 1. How can I go about changing the version?

My attempt to upload an apk file on Google Play has hit a roadblock. The apk file was created using Unity3D. Google Play is giving me an error message stating that I need to use a different version code for my APK because a version with code 1 already exis ...

Creating an HTML document with unique characters

I am currently facing an issue with writing special characters in HTML. My program is designed to edit an HTML file and allow users to replace content using a text box. However, I am struggling to add characters like "ç", "á", "ö", etc. These character ...

Z-index problem occurring with rotateY on Safari and Chrome Mobile

https://jsfiddle.net/nxbg7rq3/ I've been struggling to get the .mask completely on top of the .screen in this example. It works fine in most browsers, but Safari and Chrome Mobile are giving me a hard time. I've experimented with various solutio ...

Expanding a centered div beyond 100% width will cause the div to only enlarge towards the right side

I am currently in the process of revamping the login page for my website. I am facing a challenge where I am unable to adjust a div element to extend beyond 100% without it overflowing to the right side instead of the left. Despite trying various methods, ...

What is the process for adding CSS to a Zend project?

I am encountering an issue with appending images or CSS files in my Zend project. I have placed my CSS file in the following directory: project/public/css/style.css Unfortunately, when attempting to include this CSS file on my page, it does not work as e ...

Which is more effective for transferring data between pages: HTML5 storage or Angular services?

I'm currently exploring ways to transfer data between two pages that have Angular controllers. So far, I've discovered two methods for passing data: through an Angular service (similar to the example found here) using HTML5 storage opti ...