The overflow scroll feature is activated, causing the background to appear greyed out, yet the

I've been struggling for hours to achieve this layout: Check out the code example here

html,
body {
  height: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
  margin: 0px;
  padding: 0px;
}

.MyNavbar {
  height: 30px;
  background-color: red;
}

.Main {
  height: -webkit-calc(100% - 30px);
  height: -moz-calc(100% - 30px);
  height: calc(100% - 30px);
}

.Main:after {
  content: "";
  display: table;
  clear: both;
}

.Sidebar {
  height: 100%;
  width: 10%;
  float: left;
  background-color: yellow;
}

.Content {
  height: 90%;
  width: 90%;
  background-color: #e8e8e8;
  float: left;
}

.ContentHeader {
  height: 30px;
  width: 100%;
  background-color: blue;
}

.ContentData {
  background-color: lightblue;
  /*margin-top: 10px;*/
  height: calc(100% - 30px);
  overflow-y: scroll;
}
<!DOCTYPE html>
<html>

<body>
  <script src="src/index.js"></script>
  <div style="height: 100vh;">
    <div class="MyNavbar">myNavbar</div>
    <div class="Main">
      <div class="Sidebar">
        Sidebar
      </div>

      <div class="Content">
        <div class="ContentHeader">
          ContentHeader
        </div>

        <div class="ContentData">
          ContentData<br /><br />

          <p>Lorem Ipsum</p>
          <br />
          <p>Lorem Ipsum</p>
          ...

          <p>Lorem Ipsum</p>
          <br />
          <p>Lorem Ipsum</p>
          <br />

          <h3>End of ContentData</h3>
        </div>
      </div>
    </div>
  </div>
</body>

</html>

I've been facing some issues: - The scrollbar in the ContentData section is not working, it remains greyed out. - If I remove the "Lorem Ipsum" content, the ContentData section does not occupy the desired height to fill the display size.

Any guidance on how to solve these problems would be greatly appreciated. Thank you!

Answer №1

To proceed, you must eliminate the comment from the code snippet below:

.Content {
  /*height: 90%;*/
  width: 90%;
  background-color: #e8e8e8;
  float: left;
}

html,
body {
  height: 100%;
  overflow-y: hidden;
  overflow-x: hidden;
  margin: 0px;
  padding: 0px;
}

.MyNavbar {
  height: 30px;
  background-color: red;
}

.Main {
  height: -webkit-calc(100% - 30px);
  height: -moz-calc(100% - 30px);
  height: calc(100% - 30px);
}

.Main:after {
  content: "";
  display: table;
  clear: both;
}

.Sidebar {
  height: 100%;
  width: 10%;
  float: left;
  background-color: yellow;
}

.Content {
  height:100%;
  width: 90%;
  background-color: #e8e8e8;
  float: left;
}

.ContentHeader {
  height: 30px;
  width: 100%;
  background-color: blue;
}

.ContentData {
  background-color: lightblue;
  /*margin-top: 10px;*/
  height: calc(100% - 30px);
  overflow-y: scroll;
}
<!DOCTYPE html>
<html>

<body>
  <script src="src/index.js"></script>
  <div style="height: 100vh;">
    <div class="MyNavbar">myNavbar</div>
    <div class="Main">
      <div class="Sidebar">
        Sidebar
      </div>

      <div class="Content">
        <div class="ContentHeader">
          ContentHeader
        </div>

        <div class="ContentData">
          ContentData<br /><br />


          <h3>End of ContentData</h3>
        </div>
      </div>
    </div>
  </div>
</body>

</html>

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

Implement a smooth transition effect when changing the image source

I am currently working on enhancing a Squarespace website by adding a new image fade-in/fade-out effect when the mouse hovers over one of three buttons. The challenge I'm facing is that the main static image is embedded as an img element in the HTML r ...

Navbar-toggle divider shade

I am having trouble changing the color of the line break on the Twitter Bootstrap 3 navbar-toggle function. Upon viewing this image, you can see that there is a line break using my background color. https://i.sstatic.net/qgVAm.jpg I have tried several o ...

Adjusting the width of columns in a flex layout using Bootstrap 4

On mobile, I am attempting to rearrange some elements in a different order. Currently, this is what I have: https://i.stack.imgur.com/fY3PQ.png Below is the HTML code: <main> <div data-color="yellow"></div> <div class="wrapper"& ...

sketch a portion of a picture on a canvas

My challenge involves a canvas with dimensions of 400 by 400, and an image sized at 3392 by 232. I am looking to crop the first 400 pixels of this image and display them within the canvas. How can I achieve this task? $(document).ready(function () { v ...

Encountering insurmountable obstacles in accessing AliExpress

I'm looking to extract specific information from aliexpress using scrapy and selenium. However, I've encountered an issue where the HTML code appears differently when inspecting with Chrome compared to viewing the source. It seems that the conte ...

Adjust grading system based on user interaction with JavaScript

I am currently working on a grading system for a website and I am attempting to modify the interpretation of grades when a column is clicked. Specifically, I am looking to convert Average (%) to Letters to 4.0 Grade Average. To achieve this, I am using Jqu ...

Unable to link href attribute in project

My issue is that clicking the updates button does not load its page. Here's the relevant part of the code: <div class="st-container"> <input type="radio" name="radio-set" checked="checked" id="st-control-1"/> <a href="home.html ...

Printing long contents on Chrome's ion-modal-view is not supported on every page

I have tried various solutions found in articles but have not been successful. Here is an example of one such attempt: @media print { .modal { position: absolute; left: 0; top: 0; margin: 0; padding: 0; visibility: visible; / ...

Altering the JavaScript variable by selecting an option from a dropdown list

After downloading a choropleth map from leafletjs.com, I encountered an issue with multiple JS files labeled by year (e.g. us-states2012.js, us-states2013.js). The challenge now is to implement a drop down menu in such a way that selecting a specific year ...

How can CSS be used to prevent line breaks between elements in a web page?

div#banner>img { float: left; background-color: #4b634b; height: 265px; width: 80%; } ul { float: left; background-color: #769976; width: 162px; } <body> <div id="wrapper"> <header> <nav> <ul ...

ways to run php script based on screen resolution or size

I have 2 php files that I need to execute based on screen size. include_once('large.php'); include_once('small.php'); The condition is to run large.php when the screen size is greater than 992px, and small.php when the screen size is ...

The functionality of Ng-Show is acting up

$scope.stay = function() { alert("Inside Keep me In") $scope.timed = false; $scope.isLogStatus = true; } $scope.displayAlert = function() { $scope.timed = true; alert("inside display") } function idleTimer() { var t; $window.o ...

Spin only the outline with CSS

I have a unique idea for my webpage - three spinning circles surrounding text, while the text itself remains stationary. My challenge is to achieve this effect using only CSS, specifically by utilizing the .spinner-border class from Bootstrap. I cannot ma ...

A layout featuring a grid of 3 rows and 2 columns, each containing 6

Is there a more effective method to construct this 3x2 "table" using DIVS? I'm considering using traditional tables code <table> since it's simpler, but modern practice leans towards Divs. So, what is the most polished approach to achiev ...

Custom-designed scroll bars that perfectly match the size of the content window

Currently attempting to adjust the layout of my webpages in order to enable scrolling for dynamic content across various pages. I have made adjustments to the header, footer, and sidebar elements, but am facing issues with implementing proper overflow prop ...

What is the best way to position a small square box over each td element containing text using css?

Currently, I am in the process of developing an HTML table where I would like to incorporate a square box around each td element using CSS <tr> <td style="width:8%; text-align:center; border: 1px solid #000; margin-left: 30px;"><?php e ...

How can I make an HTML button function with a JavaScript script?

When I click a button in an HTML file, it should trigger a function in a JavaScript file to display an alert that says "hey." However, this simple task is not working for me and I am unsure why. Java Script is enabled in my browser (Google Chrome) and I am ...

Arrange components within the form

Just started experimenting with this a few days ago. In my form, there is a text field and a button that I want to align side by side at the center of the form. .row { width: 100%; margin-bottom: 20px; display: flex; flex-wrap: wrap; } .col-6 { ...

Strip the quotes from MVEL's @foreach when iterating over a string array

I am currently using the @foreach Orb notation within MVEL to loop through a string array. someArrayPartOfAJSONObject = ["Item 1", "Item 2"] <ul> @foreach{item: someArrayPartOfAJSONObject} <li>@{item}</li> </ul> However, when ...

Tips for creating a unique custom UI headline using ReactJS, CSS, and bootstrap

Looking to create a design that is responsive in ReactJS using Bootstrap or CSS if needed. I need assistance with placing separators between columns and ensuring the values of each label are aligned in the same column but on the next line. The layout shoul ...