Utilizing the Calc() method within CSS specifically for adjusting the padding on the left and top sides

I am currently working on a website using HTML and SASS. My design includes a fixed header and aside sections.

    header{
        width: 100%;
        box-shadow: 0 0 4px rgba(0,0,0,.25);
        position: fixed;
        z-index: 5;
        top: 0;
        left: 0;
        right: 0;
    }
    aside{
        height: 100vh;
        width: 320px;
        border-right: 1px solid #e2e2e2;
        position: fixed;
        top: 0;
        left: 0;
        text-align: center;
        padding: 0 1.25rem;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        flex-direction: column;
        -webkit-box-pack: center;
        justify-content: center;
        z-index: 3;
    }
    main {
        padding: 69px 0 0 320px;
        z-index: 1;
        overflow: hidden;
        width: 100%;
    }

The issue I'm facing is that the main content is not utilizing the full width of the page. I'm looking for a way to use the calc() function in the main section to subtract the padding values from the width. For more clarity, you can refer to this screenshot.

Answer №1

Experiment with setting the width to calc(100% - 320px);

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

Remove information inside table cells <td> when the table is in edit mode by using JavaScript or jQuery

I am facing an issue where I need to clear the data in a HTML td onfocus, especially in an editable table using JQuery tabledit. The table is populated with data from a database and I want to be able to edit a td without having to manually delete the exist ...

Is it possible to utilize nth-child() without recursion?

Can the CSS selector parent child:nth-child() be used to target only children? The HTML code is as follows: <body> <div>div 1</div> <div> div 2 <div>div 2.1</div> <div>div 2.2</ ...

Using jQuery to select ASP control based on its dynamically generated Name attribute

When attempting to reference an ASP control in JavaScript, I initially used the generated ID but encountered issues. Surprisingly, referencing the control by its generated "Name" proved to be successful. ASP <asp:CheckBox ID="chkMyself" runat="server" ...

Header misalignment occurs when the user scrolls up too quickly causing it to display

One interesting feature on my website is that the header disappears as users scroll down the page, but reappears when they start scrolling back up, even if they are halfway down. However, if a user quickly scrolls up and down, there seems to be an issue wi ...

Modify a singular aspect of shorthand background attribute

Imagine using the shorthand background property to define multiple properties. For example: .img { background: url('/Content/images/a.png') no-repeat scroll 100% 3px; } If you need to override just the background-position of the image, sh ...

Implementing a dropdown button functionality with a click event using knockout.js

I have a button dropdown with options that functions as intended, but I am looking to remove the input circle image in the options. Is this possible? Any other ideas would be greatly appreciated! Thank you. <div class="dropdown"> <b ...

navigating through tab menus based on time intervals

I'm a beginner in the world of HTML and website building. I have all my content ready to display on my site, but I'm looking for assistance in automating tab switching. Is it feasible to alternate between tabs every 5 minutes? Can someone guide m ...

jquery's animation causing elements to move abruptly when containing text

For the past hour, I've been grappling with jQuery and could really use some assistance. The following example showcases smooth animations: when you click on either of the divs, the selected div will move left or right if the viewport is wider than 70 ...

What is the best way to conceal just the scrollbar thumb in a Bootstrap modal?

When opening a modal in Bootstrap according to the documentation, it only hides the scrollbar thumb, like shown in the examples below: However, my modal hides the entire scrollbar. How can I modify it to hide only the scrollbar thumb? body { height: ...

Stop a single piece of data from continuously cycling

<?php include ("config.php"); $results = $mysqli->query (" SELECT orders_history.transaction_id, orders_history.items, orders_history.quantity, orders_history.on ...

Is Material-ui's sx feature able to produce optimized utility classes like tailwindcss?

When utilizing Tailwind CSS, it is compiled in the following manner: <div class="font-bold"></div> <div class=".font-bold"></div> This compiles to: .font-bold{ font-weight: bold; } So... when using SX like thi ...

Implement a captivating hover effect on every single element within a particular class

I created a basic website with the following design: However, there is an issue with the hover effect. It only works on the specific area where the mouse pointer is located (here ipsum). My intention was for the hover effect to work on all elements. To fi ...

Should the refresh button be displayed once the animation finishes?

Can anyone provide guidance on how to write jQuery code that will reveal a hidden button after an animation is finished? The button should also be able to refresh the animation for the user to watch again. Check out this fiddle: http://jsfiddle.net/rabela ...

When it comes to printing, the @Media CSS rule

I have a specific structure on my HTML page: <html> <head></head> <body> <nav> .... navigation menu </nav> <div> <div></div> <div class="to-print"> <h2>Th ...

Using jQuery to add an element at the current caret position

Within my contentEditable div, there is a table nested. Here is an example of the HTML structure: <div id="divId" contenteditable="true"> <table> <tbody> <tr> <td><br></td> ...

What are the steps for utilizing ReGex on a webpage?

Recently discovered Regex, so apologies if this is a beginner question, but I want to implement it on a webpage. I gave it a try, but it didn't work. Is there a specific library, SDK, or piece of code that I need to add? Here is the code I currently h ...

What could be causing my Javascript clock to malfunction?

I am having an issue with my clock code, which is supposed to display the date and time set 2 weeks in advance. Unfortunately, it is not working on either local or server environments. Can anyone help me troubleshoot this problem? Here is the code that I ...

Input field, upon receiving focus, triggers a subtle shift in the position of the submit button

Thank you for the assistance, I believe this issue should be an easy fix. I have added a custom :focus style to my input that removes the default outline and adds a box shadow and border. However, when the input field is focused, the submit button located ...

Fading effect of Bootstrap JS on reducing content size

My quest for a toggle collapse button led me to this helpful link: https://getbootstrap.com/docs/4.0/components/collapse/ I found what I needed, but encountered an issue with the transition; clicking on the button immediately reveals my div. I desire a slo ...

Eliminate placeholder text when the tab key is pressed

I'm currently facing an issue with a textarea that has a placeholder and the Tab key functionality in Internet Explorer. I've included placeholder.js to make it work, but when I repeatedly press the tab key and focus on the textarea, the placehol ...