Page items do not expand to fill the page when zooming out

When I try to zoom out in my browser, the elements within #workspaceMain such as #pagename, #toolbar, #content, and #tabs do not expand to fill the remaining space within #workspaceMain, even though I have set all widths to 100%. The width of #workspaceMain has been set to 70% to allow space for the sidebar #workspaceSide on the right.

At 100% zoom, everything looks normal, but at lower zoom levels like 75%, the elements do not occupy the available white space.

Can anyone suggest a solution to this issue?

https://i.sstatic.net/1it7D.png

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

Here is the code snippet:

/* This is a CSS snippet */
/* All rights reserved @SomeCompany. 2022 */

html > body {
    height: 100%;
    overflow: hidden;
    font-family: "Trebuchet MS", sans-serif;
}

/* Other CSS styles... */

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <title>Sample Page</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
    <link rel="stylesheet" href="../style.css" type="text/css">
    <script src="https://kit.fontawesome.com/1de2bd6ce5.js"></script>
    </head>
    
    <body>
    <div id="wrapper">
        
        <div id="navigation">
        <a href="#" class="current" title="Home Workspace"><i class="fal fa-home"></i></a>
        <a href="#" title="Learning Workspace"><i class="fal fa-chalkboard"></i></a>
        <a href="#" title="Student Management Workspace"><i class="fal fa-user"></i></a>
        <a href="#" title="Administration Workspace"><i class="fal fa-cog"></i></a>
        <div class="navLinks">
        <button title="Quick Links"><i class="fal fa-bookmark"></i></button>
        <button title="Sign Out"><i class="fal fa-sign-out-alt"></i></button>
        </div>
        </div>
        
        <div id="workspaceMain">
            
            <div id="pagename"><i class="fal fa-door-open"></i> Welcome</div>
            
            <div id="toolbar">
            <button class="toolLinks" title="Save Changes"><i class="fal fa-save"></i> Save</button>
            <button class="toolLinks" title="Print This Page"><i class="fal fa-print"></i> Print</button>
            </div>
            
            <div id="content">
                <h3 class="mainHeader" contenteditable="true">School</h3>
                <table class="gridSet">
                <caption class="gridName" contenteditable="true">Weekly Outline</caption>
                
                <!-- Table content here -->
                
                </table>
            
            </div>
        
            <div id="tabs">
            <a href="#" title="Notices"><i class="fal fa-newspaper"></i> Notices</a>
            <a href="#" title="Dashboard"><i class="fal fa-chart-line"></i> Dashboard</a>
            <a href="#" title="Timetable"><i class="fal fa-calendar-alt"></i> Timetable</a>
            <a href="#" class="current" title="Welcome"><i class="fal fa-door-open"></i> Welcome</a>
            </div>
            
        </div>
        
        <div id="workspaceSide">
        
            <div id="tabsPanel">
            <button class="current" title="Summit News"><i class="fal fa-newspaper"></i></button>
            </div>
            
            <div class="infoPanel"></div>
        
        </div>
        
        </div>
    </body>    
</html>

If anyone has a solution, please share. Thank you, Tom

Answer №1

If you are facing CSS issues, I can help by optimizing your code using the flex properties of CSS. By comparing your current code with the optimized code, you can easily understand the improvements made.
Utilizing display: flex; or display: table; can yield better results in your layout.
For more insights on these properties, check out https://www.w3schools.com/css/css3_flexbox.asp

/*
~ Copyright (c) Summit Learning Management System (made by students, for students). 2019.
*/

...
<!DOCTYPE HTML>
<!--
    ~ Copyright (c) Summit Learning Management System (made by students, for students). 2019.
-->

...

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

The function "onClick" within an external .js file is being referenced

Just starting to learn Javascript and experimenting with an onClick event for an image in an external .js file using the HTML tag. <script type="text/javascript" src="embed.js"> The code found in "embed.js" is as follows: var image1=new Image(); i ...

CSS Begin the background repeat from a specific origin

I am trying to achieve a specific background effect starting from the line shown in the screenshot below: I attempted to implement it using the following CSS code: background : ('path/to/image') 0 650px repeat-y However, the light part of the ...

When combining <a> with the class line-through, the line does not appear

I am currently utilizing a class to replace the deprecated strike in HTML: .entfall { text-decoration: line-through; } However, when using Firefox 38.x and the following code: <span class="entfall"><a href="some link">text</a></span ...

Modify MUI's ListItemText component by targeting a specific span to implement customized styles using the useStyle hook

It's quite perplexing that although this is a straightforward task in regular CSS, it must be accomplished through MUI's useStyles for some peculiar reason. Essentially, I possess a ListItem containing a ListItemText. It appears as follows: cons ...

Encourage the user to download and install the ActiveX/.Net Class Library directly from their browser

When I developed a .NET Class Library project that interacts with mshtml.HTMLDocument from JavaScript, everything functioned correctly on my local machine after adjusting permissions in .NET Configuration for Trusted Sites to grant Full access. However, I ...

Essential symbol needed for labeling the user interface element

My HTML includes a dynamic label component where the 'required' value is determined by an API response that can be either true or false. Is it feasible to assign the property ojComponent{ required: true } for this label? *Date From ---- To --- ...

Function for masking phone numbers is adding additional "x's" to the input field

My phone number formatting script is supposed to add dashes after the third and sixth characters, as well as insert an "x" after the 10th character for extensions. However, it is adding extra "x's" after the 12th character, resulting in the incorrect ...

Using CSS3 to apply transformations to multiple divs based on their individual attributes

I am currently developing JavaScript code that will enable the use of HTML like the example below: <div class="box" data-vert-speed="7">ContentDiv1</div> <div class="box" data-hori-speed="10">ContentDiv2</div> <di ...

Exploring CSS3 animations: customizing animations for individual elements based on scroll movements

Can you help me with CSS3 animations triggered by scrolling? I came across a code that reveals a DIV element as the user scrolls down: <script type="text/javascript"> $(document).ready(function() { /* Every time the window ...

Is the issue of Padding Overlap with Sidebar Item List getting in the way?

I am currently new to coding in HTML and CSS, so please bear with me if my code seems outdated or unconventional. I am working on creating a basic test website with a sidebar, but I'm encountering an issue where the items in my list are overlapping du ...

How to access the current class in Sass without referencing the parent class

.site-header .basket position: relative &-container width: 100% padding: 0 18px $basket: & &.opened #{$basket}-link border: 1px solid #e5e5e5 ...

Is it possible to include spaces in a JavaScript alert message?

Is it possible to add spaces in an alert message? I have been trying to include spaces in my alert messages, but the alerts do not appear when there are spaces. Example where it works: https://jsfiddle.net/yczrhztg/ Example where it doesn't work: ht ...

Move the final column from one table to another table given a specific criterion

I have a task where I need to extract the last column from table3 and transfer it into table4. For example, consider table3: Names Process_id Total construction 1 1111 construction_1 1 0000 engineering 1 22 ...

Steps to adding a collection of links (stylesheets, javascript files) to each html document

Is it feasible to add a list of links to multiple HTML files? I was inspired by W3 School's W3 Include functionality, which allows you to import blocks of HTML code into various files simultaneously, making it convenient for making changes across many ...

Setting the minimum and maximum width of a div using Bootstrap, not based on the number of columns

I want to adjust the number of columns based on the width of the screen rather than choosing a specific value like 3, 4, 5, or 6. ...

How come my counter is still at 0 even though I incremented it within the loop?

Within my HTML file, the code snippet below is present: <div id="userCount" class="number count-to" data-from="0" data-to="" data-speed="1000" data-fresh-interval="20"></div> In my Ja ...

Missing Home and Search icons on Jquery mobileNavigationBar

I am having an issue where the Home and search icons are not displaying properly in the output. Instead, they are showing up as hyperlinks. Can someone please help me with this? Here is the code I am using: <meta name="viewport" content="width=device ...

Is there a way to incorporate a JavaScript variable as the value for CSS width?

I created a scholarship donation progress bar that dynamically adjusts its width based on the amount donated. While I used CSS to handle the basic functionality, I am now trying to implement JavaScript for more advanced features. My goal is to calculate ...

Encountering obstacles when attempting to save form information to a MongoDB database using Node.js

I've been struggling to save the data entered in my form to my database, but it's not working at all. No errors are showing up and nothing is being logged. Here's the HTML code I'm using: <!DOCTYPE html> <html lang="en"> & ...

Tips for positioning fixed column headers at the bottom of the header row

I am currently working on a responsive table where the first two columns are fixed and the rest are made to float. However, I have encountered some issues and have a few questions: Why do the headers for the first two columns float to the top of the head ...