Ways to ensure the background color stretches the entire length of the page

I've been attempting to create a background image or color that extends across the entire main content area, but haven't had any success so far.

For reference, please visit

My attempts have involved adding a class called fill to the container-fluid div, as well as trying with the page-content-wrapper div...

.fill {
    height:100%;
    background:darkblue;
}

...However, the background doesn't expand beyond the vertical height of the contained #story-bar div.

Answer №1

When using a percentage height for the .fill element, its height is calculated relative to its parent. To ensure proper styling, you must define a specific height for each ancestor all the way up to the html and body elements:

html,body,
div#wrapper,
div#page-content-wrapper {
    height:100%;
}

Additionally, make sure to include a semi-colon after setting the height property for the .fill class:

.fill {
    height:100%;
    background:darkblue;
}

You can see a working example by following this LINK.

(The link is external as the code snippet couldn't be fully demonstrated here.)

Answer №2

Change the height to 100% for the col-lg-12 class

Answer №3

Simply omit the height:100% from your code and experiment with the following:

background-image: url("newimage.gif"); 
background-repeat: repeat-x;

Answer №4

To achieve a darkblue background for the entire webpage, you just need to add the following style rule to your "body selector":

Example:

body {
    background-color: darkblue;
}

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

Issue with PHP redirection not functioning as expected upon submission

Thank you for taking the time to offer assistance. I am encountering an issue with a basic HTML contact form that utilizes a PHP file for processing. The form's method is set to post and it directs its action to a PHP file. Upon completion of the PHP ...

Unable to retrieve $wpdb, returning as null

In my development process, I am working on a basic plugin using the Wordpress Plugin Boilerplate. I have implemented AJAX to create an action triggered by a button press to remove an item from a custom database table I have set up. The AJAX function, butto ...

Trouble opening attached html file with Asp.net and Google Charts integration

I am facing an issue with my Asp.Net page that includes a grid and an image. The image is a Google Charts chart with a URL of approximately 1600 characters. To send this content as an email attachment, I created an .htm file containing the grid and the ima ...

PHP - Truncated html string when appending

I have a situation where I am using PHP to generate HTML for the MPDF library in order to create a PDF file. However, when I include a loop within my PHP-generated HTML, it seems to be cutting off the initial part of the string. Below is the code snippet: ...

Position the two input boxes next to each other

I need help re-arranging my input boxes on a web page. Currently, they are stacked on top of each other vertically and I would like them to be displayed horizontally with two boxes per row. Here is an example of how I'd like them to look: https://i.ss ...

Fixing CreateJS in Adobe Animate HTML5 Advertisement for Internet Explorer versions 9 and 10

As I work on creating an HTML5 ad using Adobe Animate CC, I encounter a minor setback. While testing the ad, I notice that it displays perfectly in most browsers except for Internet Explorer versions 9 and 10. It's interesting to see that according ...

Is there a way to position these divs in a line using inline-block?

I need help aligning two divs with text differently - one to the top left and the other centered but not on the same line. Here's the layout I'm aiming for: ---------------------------------------------- |Backstage |Issue 4 | | ...

Is it possible to use HTML code as content in CSS?

How do I go about displaying the variable $text as HTML? Take a look at the code snippet provided below: <?php header('Content-type: text/css'); $background = "#ffafff"; $color = "#000000"; $green = "#16a86f"; $text= '<h1&g ...

Issue with width loss when using Bootstrap 4 aligning center self in IE11

I'm having trouble centering my .row element along the y-axis in IE11. Despite my efforts, it doesn't seem to be working. Here is my HTML: <section class="home-section"> <div class="container home-section-inner d-flex"> ...

Issues regarding the CSS navigation bar

I'm currently working on creating a navigation bar using HTML and CSS. However, I'm facing an issue where the nav-bar doesn't extend to the full width of the page as intended. I've attempted adjusting the padding-left: 0px and padding-r ...

Exploring the intricacies of using jquery text() with HTML Entities

I am having difficulty grasping the intricacies of the jquery text() function when used with HTML Entities. It appears that the text() function converts special HTML Entities back to regular characters. I am particularly uncertain about the behavior of thi ...

Bulma's Grid System Spans Columns Across the Entire Viewport

Utilizing the Bulma CSS framework. In my attempt to arrange some elements, I am puzzled as to why, in a desktop view, the items do not transition to the next row once they exceed the viewport. Below is a snippet of code along with a link to a JS Bin exam ...

The pagination feature is not functioning correctly - experiencing issues with will_paginate and bootstrap4

Just starting out with Rails and I've successfully added will_paginate to my project by following the instructions and configuring everything. It's now showing the page numbers, but there seems to be a problem - there is no space between the page ...

What could be causing my CSS div class to cover up the image in the background?

Within my HTML code, I have a <div> that contains a whole partial view: <div class="bkgImg"> /* content goes here */ </div> Inside this main <div>, there are two additional <div> elements - one without a class and one wi ...

What is the process for choosing and making changes to a specific portion of a textContent?

<h1 id="block ">This is my header block</h1> To dynamically change the color of the "block" word every 2 seconds using JavaScript: let colors = ["blue", "green", "pink", "purple"]; let curColor = 0; const changeColor = () => { ...

Implementing JavaScript functionality based on a specific body class

Is there a way to execute this script only on a specific page with a particular body class? For example, if the page has <body class="category-type-plp"> How can I target my script to work specifically for "category-type-plp"? plpSpaceRemove: fun ...

Can you explain the purpose of the "for" attribute in the <output> tag of HTML?

I'm puzzled by the purpose of the for attribute in the new HTML5 output tag, as the result doesn't seem to change based on its presence. This query was raised back in 2012 during the era of HTML4. However, with the introduction of HTML5 in 2014, ...

Click event to reset the variable

The code snippet in Javascript below is designed to execute the function doSomethingWithSelectedText, which verifies if any text is currently selected by utilizing the function getSelectedObj. The getSelectedObj function returns an object that contains in ...

Utilizing JSON format, handling special characters, and storing data in a database

My friend approached me with a question and although I wanted to offer immediate help, I realized that seeking advice from others may provide better solutions. Situation: Imagine there is a Form that includes a RichText feature: DHTMLX RichText (). This R ...

What is the best way to arrange form inputs in a single row?

My form consists of three input boxes. While the first two inputs are single line, the third is a description field with 10 rows set as default. However, for some reason, this third box is not aligned properly with the other two. Please refer to the screen ...