Trouble with div height 100% not syncing with bootstrap and wordpress

This particular code (by the way, taken from another stackoverflow post) is functioning properly as the red div#wrapper extends from top to bottom...

<html>
<head>
<style media="screen">
#wrapper {
    height:100%;
    width:300px;
    background-color:red;
}
#first {
    background-color:#F5DEB3;
    height: 200px;
}
</style>
</head>
<body>
    <div id="wrapper">
        <div id="first"></div>
    </div>
</body>
</html>

However, when attempting to incorporate this into a WordPress + Bootstrap + Timber theme, it fails to work... even with a html,body{height: 100% } declaration in style.css...

It remains uncertain whether this issue stems from Bootstrap or Wordpress...

hmtl, body{
    height: 100%!important;
}

#wrapper {
    height:100%!important;
    background-color:red;
}

.navbar-brand-image{
    margin: 0 auto;
}

@media (max-width: 1000px) {
    .navbar-header {
        float: none;
    }
    .navbar-toggle {
        display: block;
        float: none;
        text-align: center
    }
    .navbar-collapse {
        border-top: 1px solid transparent;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    }
    .navbar-collapse.collapse {
        display: none!important;
    }
    .navbar-nav {
        float: none!important;
        margin: 7.5px -15px;
        width: 100%;
    }
    .navbar-nav>li {
        float: none;
    }
    .navbar-nav>li>a {
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .navbar-text {
        float: none;
        margin: 15px 0;
    }
    /* since 3.1.0 */
    .navbar-collapse.collapse.in {
        display: block!important;
    }
    .collapsing {
        overflow: hidden!important;
    }
}



.navbar{
    margin-bottom: 0px
}

.navbar .navbar-nav a{
    color: #fff;
    font-weight: bold
}

.navbar .navbar-nav a:hover{
    background-color: rgba(0, 0, 0, 0.2);
}

.navbar .navbar-nav {
    display: inline-block;
    float: none;
}

.navbar .navbar-collapse {
    text-align: center;
}

Answer №1

It is difficult to determine the exact issue without analyzing the entire CSS code on the page. One workaround could be to include the !important declaration in the height property in order to override any CSS inheritance.

#container {
    height:100% !important;
    width:500px;
    background-color:blue;
}

Answer №2

When utilizing these libraries, there is a high likelihood of them overriding your existing code.

To verify if this is occurring, add !important to the end of your CSS properties.

For example:

#wrapper {
    height:100% !important;
    width:300px !important;
    background-color:red !important;
}

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

Error encountered with the item properties in vue-simple-calendar 'classes'

For my Vue.js project, I am utilizing the npm calendar package called `vue-simple-calendar` and aiming to implement dynamic classes for each event item like background-color, etc. However, the `classes` property doesn't seem to be functioning as expec ...

utilizing a single occasion for various purposes

I have the following buttons: <input class="btnRating" type="button" value="Project Rate" /> <input class="btnRating" type="button" value=" Education Rate" /> <input class="btnRating" type="button" value="Achievement Rate" /> I ...

Transitioning between sections by clicking on a navigation menu item

I'm looking to create a cool animation effect on my website. When a user clicks on a specific menu link, such as "about-section," I want the page to smoothly scroll down to that section in a parallax style. If anyone knows of a jQuery plugin that cou ...

Achieve a dynamic effect by filling a path with an image and stretching it within the Canvas element

I am looking to fill a path in the shape of a circle or custom design with an image, but I want the image to stretch so that it fits within the boundaries of the closed path. Is it possible to accomplish this using HTML5 and the Canvas object? Below is th ...

Unable to retrieve data-id from <td> on click event

Can someone help with an issue I'm having in my code? Here is the snippet where I create a table data element: html += "<td data-id='test' class='journal' style='max-width:200px;'>"+record.source_account_code+"& ...

Avoid positioning issues when dropping a DIV onto the Canvas

Utilizing the JavaScript code below allows me to drag a DIV onto a canvas. I am currently loading a multi-page PDF, which consists of image files, in a pop-up window and positioning canvas layers over them. In these canvas layers, shapes are then loaded at ...

Card carousel rotation

Apologies for the vague title, I'm unsure how to properly label my issue. I have a section set up with cards, but I'm aiming to create something resembling a menu that functions like a carousel. Essentially, I want to include right and left arro ...

Issue with Aligning Text Inputs and Images in Firefox

I am really struggling with this issue and it's driving me crazy. The problem lies with an image positioned at the end of a text input, styled using CSS. Here is the code snippet: .text_input{ background:url(../images/forms/text_input_back.png) t ...

Using CSS styles in emails can lead to an unexpected horizontal scrolling effect

I am currently working on an application using Symfony, and I have implemented a basic confirmation email with minimal CSS styling. However, the email template is causing horizontal scrolling due to the layout. Below is the HTML code of my email template: ...

Placing content in bottom and moving towards the left side

On my webpage, I have a div that I would like to fill with content similar to the image. How can I achieve this without resizing the div and instead populate it from bottom to top? ...

When running Javascript, the code is displayed rather than being executed

I have a current MVC - C# application that generates various "popup" screens containing necessary information. I wanted to apply the same method to create a popup displaying a version history (listing the Versions with their corresponding changes). Howeve ...

Sass: Overcoming the challenge of the IE limitation on 4095 selectors per stylesheet

Hey there! Are you working on a Rails project with Sass & Compass? If you're using the Rails Asset Pipeline, check out this question. We're in the process of developing a large application with multiple use cases and various individually styled ...

Fetching data to a dropdown menu in Laravel 5

In my application, I have a requirement to display records that are foreign keys in a select dropdown. The select should only show the name of a food plate. I have the following tables: plato and platoIngrediente (where the foreign keys reside). Migratio ...

Tips for transferring an array of images to a controller via ajax

Purpose: To convert the image array items into an input list and send them to the controller. Below is the JavaScript code that selects and modifies images: const output = document.querySelector("output"); const input = document.getEleme ...

Why is my Angular form submitting twice?

Currently, I am working on a user registration form using AngularJS with ng-submit and ng-model. However, I am facing an issue where the form triggers submission twice when the user submits it. I have checked for common causes such as declaring the contro ...

Ensure that the elements within the container automatically adjust their height to fill the entirety of the

I am facing a challenge in getting the items within a container to occupy the space in the desired way. The main issue lies in the fact that flexbox and CSS grid are designed to adjust to changes in width rather than height, whereas I require the opposite ...

What is an alternative way to retrieve the page title when the document.title is unavailable?

Is there a way to retrieve the page title when document.title is not available? The code below seems to be the alternative: <title ng-bind="page.title()" class="ng-binding"></title> How can I use JavaScript to obtain the page title? ...

Angular 9 introduces a fresh approach to compiling alternate components

I am trying to append HTML to a div and have it compile the variables, loops, and all the Angular component elements within the string. The HTML content is being uploaded via a text file. While I am aware that this can be achieved using $compile in Angular ...

Guide to embed a Google Sheets chart into a WordPress website

I'm looking to include a chart in a wordpress post, using the script generated from google sheets' publish function. When I add the script to a generic HTML page, the chart displays properly. However, when I insert it into a wordpress post, I en ...

Issue with Bootstrap Carousel Indicators malfunctioning

I've been working on a website project for a client's portfolio, and I'm using Bootstrap Carousel in the index. The carousel showcases different projects with custom indicators made of text instead of the usual style. If you take a look at t ...