Steps for positioning a DIV at the bottom of the first printed page using HTML and CSS Bootstrap

I attempted to achieve a certain output by setting the <div> element's position to absolute, but it ended up being pushed all the way down to the bottom of the page.

My goal is to accomplish this task without relying on any PDF libraries.

https://i.sstatic.net/ld2JY.jpg

Answer №1

There are numerous approaches to achieve this task. Here, I present two methods: one utilizing flexbox and the other employing absolute positioning.

Answer has been updated.

.container2{
display:flex;
height:100vh;
width:100vw;
justify-content:center;

}

#page4{
background:pink;
position:relative;
}

#bottom2{
position:absolute;
height:20vh;
width:30vw;
left:calc(50vw - 30vw/2 + 10vw);
background:purple;
top:calc(100vh - 20vh);
}

#content{
height:35vh;
width:80vw;
background:white;
margin-top:10vh;

}
<div class='container2' id='page4'>
<div id='content'>
</div>
<div id='bottom2'></div>

</div>
<div class='container2' id='page5'>

</div>
<div class='container2' id='page6'>
</div>

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

Achieving scrollable tab content in Bootstrap 4.1 with flex: A simple guide

I have a similar query to the one discussed in this thread, but my goal is to utilize bootstrap's flex feature for achieving a "dynamic" height for the tab-content. The code snippet below results in a scrollbar encompassing the entire page, whereas I ...

Ways to add extra dots to your listing style

Is there a CSS property or list style that can display an expanding list? For example: Order now for a discount! <ol style="list-style: none"> <li>* Available only for the first 12 months</li> <li>** Only for new customers ...

Clicking will open the link in both a new tab and the current tab

I'm looking to enable ng click functionality to work in both new tabs and the current tab. The URL is dynamically generated based on a certain condition. Here is the HTML: <a ng-href="{{myPathVariable }} " ng-click=" GoToThemes()" class="shift-l ...

Capture various data points in an array with each click

I am currently working on a menu of buttons where users can select multiple options at the same time. My goal is to record all selected buttons in one array instead of individual arrays for each button. The end result I hope to achieve is an array like t ...

Canvg | Is there a way to customize canvas elements while converting from SVG?

Recently, I encountered an issue with styling SVG graphics dynamically generated from data. The SVG graphic appears like this: https://i.sstatic.net/xvIpE.png To address the problem, I turned to Canvg in hopes of converting the SVG into an image or PDF us ...

Dynamic generation causing Bootstrap tabs to malfunction

I have incorporated a bootstrap tab on my website, which is generated dynamically through ajax requests. While testing the static version of these tabs, everything was functioning perfectly. However, now that I am generating all tabs and panes dynamically ...

Creating a mouse-resistant div with a magnet-like effect

Looking for a way to make a circle move like a magnet effect when the mouse is near, causing elements underneath it to be exposed. If you want to see an example, check out this fiddle link: http://jsfiddle.net/Cfsamet/5xFVc/1/ Here's some initial c ...

The navbar toggler icon is not displaying

<header class="container"> <div class="container pt-3 col-md-5 col-sm-5 col-xs-6 text-center"> <a href="#" class="site-logo"><img src="#"></a> <button class="navbar-toggler" type="button" data-toggle="collapse" ...

How can I create an input field that comes with a preset value but can be updated by the user with a different name?

I am in need of a solution that will enable a user to update text on a webpage dynamically. I have been unable to find any information on how to achieve this. Is there anyone aware of a method to implement this feature? Perhaps a library or utilizing Vue ...

Align the content evenly on several cards using Material-UI

Trying to work on some frontend coding, but struggling with getting the content justified properly in fixed-height MUI cards. Each card consists of a title, description, divider, and author, but I can't seem to get everything aligned correctly within ...

CSS Drop-Down Menu Fails to Function Properly in Firefox and Internet Explorer

Can you help me with this issue I'm having with my website design? In Google Chrome, Opera, and Safari, everything looks great. But in Firefox and the latest version of IE, it's a different story. Here is the HTML code: <div id="navbar"> ...

Click to refine list or view

Currently, I am engaged in creating my own version of a social media platform inspired by Twitter. In this project, tweets are being automatically generated from a JavaScript file. One key feature I'm working on is that when a user clicks on a usern ...

Displaying JSON data using FormControls in Angular 5

Upon receiving Json values from the server, I am encountering an issue while binding them to respective textboxes. The problem arises as the value in the textbox appears as [object object] <h1>{{title}}</h1> <h3>Catalog</h3> ...

Retrieve image data by capturing the image from the input field and showing it on the screen

I've been searching online and can't seem to find a clear answer on whether this task is possible. Here's what I want to achieve before submission: When a user chooses a file for upload, I aim to extract the image data and convert it into b ...

Fine-tuning components in HTML and CSS

Is there a way to align the asterisk symbol with the text and adjust the positioning of the Yes and No elements as depicted in the image? https://i.sstatic.net/mCsUG.png Check out this fiddle: https://jsfiddle.net/07bd0hda/ and snippet below: <div ...

Switch backgrounds of various divs upon hovering

I am looking to achieve a design with 4 divs where one is larger and the other three are smaller. Upon hovering over one of the smaller divs, I want the background-image of the large div to change to match that of the hovered small div. Is there a way to a ...

Tips for eliminating the gap between Bootstrap 4 columns

Is there a way to eliminate the spacing between Bootstrap columns? I have three columns set up using Bootstrap but no matter what I do, I can't seem to get rid of the space between them. <!doctype html> <html lang="en> <head> ...

Creating a parallax effect across the entire webpage using just CSS

As I work on a standard WordPress website for a client, the designer has requested a subtle layer with SVG elements to be incorporated. This layer should scroll "over the normal content" parallax-style. The existing content is basic HTML with relative/sta ...

Get the nearest offspring of the guardian

I have a main 'container' div with multiple subsections. Each subsection contains 1 or 2 sub-subsections. Let's say I have a variable that holds one of the subsections, specifically the 4th subsection. This is the structure:container > s ...

Achieving a seamless integration of a navbar and video in Bootstrap 5.3: tips and tricks

I'm updating a website design using Bootstrap and I want to create a navbar with a video playing in the background. To ensure that the navbar stays fixed at the top while scrolling, I made it sticky. After testing various methods, I managed to posit ...