The cover page height is adjusted to 100%, landing it right in the middle

I've been attempting to incorporate a bootstrap cover page template, but I'm having trouble setting it up. Despite copying the code directly from Bootstrap's website, the cover page only takes up half of the height. The styles clearly specify a height of 100%, yet changing it to a different percentage has no effect. However, when I set the height to 740px, it displays properly relative to my screen size, although this may cause issues in the future. Why is it that adjusting the height percentage doesn't work as expected?

a,
a:focus,
a:hover {
  color: #fff;
}

/* Custom default button */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
  color: #333;
  text-shadow: none; /* Prevent inheritance from `body` */
  background-color: #fff;
  border: .05rem solid #fff;
}


/*
 * Base structure
 */

html,
body {
  height: 740px;
  background-color: #aaa;
}

body {
  display: -ms-flexbox;
  display: -webkit-box;
  display: flex;
  -ms-flex-pack: center;
  -webkit-box-pack: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);
}

.cover-container {
  max-width: 42em;
}


/*
 * Header
 */
.masthead {
  margin-bottom: 2rem;
}

.masthead-brand {
  margin-bottom: 0;
}

.nav-masthead .nav-link {
  padding: .25rem 0;
  font-weight: 700;
  color: rgba(255, 255, 255, .5);
  background-color: transparent;
  border-bottom: .25rem solid transparent;
}

.nav-masthead .nav-link:hover,
.nav-masthead .nav-link:focus {
  border-bottom-color: rgba(255, 255, 255, .25);
}

.nav-masthead .nav-link + .nav-link {
  margin-left: 1rem;
}

.nav-masthead .active {
  color: #fff;
  border-bottom-color: #fff;
}

@media (min-width: 48em) {
  .masthead-brand {
    float: left;
  }
  .nav-masthead {
    float: right;
  }
}


/*
 * Cover
 */
.cover {
  padding: 0 1.5rem;
}
.cover .btn-lg {
  padding: .75rem 1.25rem;
  font-weight: 700;
}


/*
 * Footer
 */
.mastfoot {
  color: rgba(255, 255, 255, .5);
} 

Answer №1

Feel free to give this a shot

html, body {
    height: 100vh;
    min-height: 100vh;
    background-color: #ccc; 
}

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

Execute javascript on webpage after reloading

My goal is to dynamically refresh a website and run a JavaScript script on it, simulating the behavior of executing code in the Chrome console. How can this be accomplished? One method I am considering involves using PHP to set up a local server that red ...

Utilizing Session storage throughout an Angular 2 application

I currently store a session variable as a JSON value in my home.component.ts. This variable needs to be accessed in various locations within the application. This is my code snippet: .do(data => sessionStorage.setItem('homes', JSON.stringif ...

Sending the slider value from a website to a program when the slider is adjusted

I have been experimenting with programming an ESP32 to regulate the LED brightness using a slider. I've pieced together some information from tutorials found on and Currently, I've achieved the ESP32 connecting to my network, displaying the sli ...

Unable to translate text on the loading page

Encountering a peculiar issue with the translate service. Here's how I set it up: export class AppComponent implements OnInit { constructor( private translateService: TranslateService, angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics ...

Displaying elements upon checkbox selection in React

Hello, I'm new to React and I am facing an issue with checkbox click handling in React. My goal is to display a div when a checkbox is checked and hide the div when the checkbox is unchecked. The current implementation only shows the div when the che ...

Encountering issues with Phaser Sprite body when receiving undefined input

I am having trouble with flicking when I click the mouse. The variable on input.on is returning undefined when I click the mouse. Here is a code snippet that explains my issue. Phaser is a new concept to me. w : number; h : number; velocity:n ...

The Bootstrap container-build fails to expand to the full width of the screen despite using the p-

When it comes to screens, I set padding at 0 for container-fluid but the screen still doesn't occupy the full width when it's less than or equal to 1024 pixels. .container-fluid { background-color: #e2e5f4; height: 600px; margin-bo ...

Exploring the concept of utilizing CSS modules within React: What is the proper technique for passing a className as a prop to

When working with CSS Modules in a React component, how can I pass a className that includes the hash generated css module name? Currently, it only provides the className itself, like this: <div className={styles.tile + ' ' + styles.blue}> ...

What is the total number of pixels taken up by a single non-breaking space character?

I am curious to find out the exact number of "px" that a single " " occupies. This information will help me calculate and provide padding instead of using   ...

Encountering an issue with the tieredMenu component in PrimeNG version 9

Currently utilizing Angular along with primeng version 9. I am aiming to incorporate hover functionality on tiredMenu. Within the primeNg library, I find that initially, I need to click in order to then hover over the menu to view the submenu. How can th ...

Stable placement in browsers using webkit technology

Having trouble with fixed positioning on webkit browsers. Works fine in Firefox, but can't seem to solve the issue. You can see the problem here: When clicking on a project, a page is loaded using jQuery's .load() function. On this page, there ...

Troubleshooting ngFor Issue in Angular 4

I've double-checked all the required modules and scanned for errors, but unfortunately, nothing seems to be helping me at the moment. As a newcomer to Angular, I'm still in the learning phase. Now, let's take a look at my app.module.ts file ...

Interested in the use of hide().after("") function in jQuery?

Check out some code here: html: <body> <p>This is a paragraph.</p> <button>click me</button> </body> Javascript: $(document).ready(function(){ $("button").click(function(){ $("p").hide().after('<p>h ...

Postpone the execution of the toggleClass function

I have a tab that, when clicked, fades in to reveal content loaded with AJAX. However, the content loads immediately upon clicking the button. I attempted to use toggleClass with delay, but it was unsuccessful. How can I effectively delay the loading of t ...

What is the best way to rearrange Bootstrap columns for mobile devices?

I have 4 columns displayed like this on desktop, and I want them to rearrange to look like the following on mobile. Do I need custom CSS for this? (I can't post images yet, so here is the link to the image: https://i.sstatic.net/b0gUZ.jpg I've ...

Angular2 combined with redux fails to produce any outcomes

Currently, I am implementing redux in conjunction with angular2 and attempting to make a call to Windows Azure Search. Below is the snippet of code that I have written: types.ts export interface IAppState { languageState?: LanguageState; searchState? ...

What is the best way to distribute stroke width evenly on a rounded hexagon in an SVG?

I created a rounded hexagon with stroke width, but the top and bottom curves appear darker. Does anyone know how to evenly distribute the stroke width along the border? Here is my SVG code: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox ...

The function FormData.append("parameter", "data") seems to be malfunctioning

Could you please help me figure out what's going on here: var formdata = new FormData(); formdata.append("key", "value"); console.log(formdata); My output is not displaying the expected "key" - "value" pair. FormData *__proto__: FormData **append: ...

How can I provide multiple values for cellRendererFramework in ag-grid?

There is a lack of information on this topic, as I have only come across one SO question that remains unanswered. In my Angular app using ag-grid, I am facing an issue with the cellRendererFramework that is used to display data in a table column. I am try ...

Building a personalized radio button Angular component for optimal integration with ReactiveForms

I have developed a custom radio button that stores the current value in the model attribute and checks if the model and value are equal in terms of styling. Everything functions smoothly when using template forms with the [(ngModel)] attribute on the tag. ...