The box shadow comes to a halt just shy of reaching the bottom of the

I'm having an issue with my box shadow on the body element. Everything looks great until I add content that causes the page to scroll beyond the viewport. The background of the body continues, but the box shadow stops short. Is there a way to extend the box shadow all the way to the bottom of the page?

CSS:

body {
  width:100%;
  height: 100%;
  text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);
}

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

Full code: https://codepen.io/jsa2025/pen/vYmbzmM

Answer №1

Why not give this a shot?

body {
  width:100%;
  height: 100%;
  text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 490px black;
  margin-bottom: -20px;
}
<body>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
  <h1>My Stuff </h1>
</body>

You might also find this question about the default Body tag margin interesting. It could be just what you need: Check out this post on natural body tag margins!

Answer №2

Looks like there was a hiccup in displaying the preview.

UPDATE: Unfortunately, the issue persists

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

Testing the local transmission of form data via Javascript: A Step-by-Step guide

Currently studying how to send forms using JavaScript by manually creating an XMLHttpRequest. Towards the end of the provided example, there's a note: Note: If you want to send data to a third party website, keep in mind that this use of XMLHttpRequ ...

Utilizing Bootstrap 4's nesting feature for optimal layout on an iPad in landscape

My nested content is functioning properly on all screen sizes except for ipad-landscape. Wouldn't it make more sense for the class triggered on ipad-landscape to be col-sm instead of col-lg? <div class="row"> <div class="col-lg-3 col-sm- ...

Steps to keep the gridlines in the chart from moving

Take a look at the example provided in the following link: Labeling the axis with alphanumeric characters. In this particular instance, the gridlines adjust dynamically based on the coordinate values. How can we modify this so that the chart remains static ...

The challenge of vertically aligning text in a dynamically generated div

Currently, I am in the process of developing a straightforward application that allows for the dynamic addition of students and teachers. I am dynamically adding divs with a click function. To these dynamically created divs, I have assigned the class "us ...

Arrange the div next to each other

Looking to position two divs side by side with widths totaling 100%? The left div will have a specified width in pixels that can change, while the right div should expand to fill the remaining space. Having trouble with this layout? Check out my example o ...

The background color disappears when viewed on mobile devices

I have created a table using HTML and CSS. The issue is that the background colors of the table display correctly on a desktop, but on a mobile phone, they appear completely transparent while the text remains visible. I am using Bootstrap 4 for this websi ...

show a pie chart at the top of the div using highcharts

i am struggling with positioning the high-chart with a label, as seen in the image below https://i.sstatic.net/m9bXW.png does anyone know how to properly display the chart from the top left corner? i have attempted to adjust the settings like this { ...

The parent element of a 3D div is causing issues with hovering and clicking on the child elements

In my scenario, the parent div is transformed in 3D with rotation, causing it to move to the backside. The issue arises with the child div containing a button that becomes unclickable due to the parent div position. Setting backface-visibility to hidden al ...

Combining two HTML tables using jQuery/JavaScript

My table is displayed below: <table id="first" class="merge"> <tr> <td>Mick Jagger</td> <td>30</td> <td>50</td> <td>10</td> </t ...

Activate the typeahead feature in ng-bootstrap 4 by setting it to open when the

I am currently using ng-bootstrap 4 (beta 8) and have the following setup: <ng-template #rt let-r="result" let-t="term"> {{ r.label }} </ng-template> <input id="typeahead-focus" class="form-control" [(ngModel)]= ...

Trouble with toggling class "collapsed" in Bootstrap v3 Navbar-toggle when using multiple data-targets

When using the data-target attribute with multiple CSS selectors, the behavior of toggling the "collapsed" class in navbar-toggle does not work as expected. If only one selector is used, the class is toggled properly, but when multiple selectors are specif ...

What steps can I take to guarantee that both images and text adapt well to different screen sizes?

Is there a way I can organize my website to display 3 movies per row with the text centered relative to the image? Here is how it currently looks (the red box is just for reference, please ignore): https://i.stack.imgur.com/w2pgN.jpg Also, when I resize m ...

Creating a zigzag pattern with a linear gradient in CSS

When attempting to create a background color for my body element using linear gradient, I noticed that it resulted in a zigzag effect I experimented with the following code: Body{ background: linear-gradient(45deg, Blue 50%, red 50%) } The outcome wa ...

What can I do to eliminate the excess white space within my div element?

I've built this app using the create-react-app CLI, but I'm struggling to remove the extra white spaces surrounding my main container. Check out the screenshot below for reference. Currently, the only div in my app has the following CSS: .main ...

Set the height of the div element to be the same as its parent element (100

Within my main div, there are two child divs. I want the first child div to have the same height as the parent div, without specifying a height in CSS. For reference, take a look at this example: http://jsfiddle.net/x8dhnh4L/ The pink div should expand to ...

Tips for positioning divs on top of an image with Twitter Bootstrap

I'm having an issue with displaying an image and dividing it using bootstrap div columns. The problem is that the image is overlapping the divs, making it impossible to click or attach jQuery events to it. Here is the code I am currently using: #view ...

Creating a personalized image resizing function for WordPress

I have implemented the following code in functions.php to fetch the first image from WordPress posts: function grab_first_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/< ...

Sections overlap, extending the content beyond their designated boundaries

I am facing an issue where the header in the first section remains fixed as an attachment, but when I resize the browser window, the background only covers a small portion of the section. The rest of the content either goes under another section or complet ...

Leveraging JavaScript to generate a downloadable PDF document from the existing webpage

My goal is to have the user click a button labeled 'View PDF' or 'Download PDF' on the current webpage. This button would then execute JavaScript code to generate a PDF based on how the current page appears. I attempted using jspdf for ...

Tips for sending Form Data and additional information via AJAX

I'm struggling with sending HTML form data using AJAX while also trying to send additional data in the same POST call. Has anyone done this before? $('#HTMLConForm').on('submit', function (e) { e.preventDefault(); ...