The HTML background color is refusing to change

I've been struggling to tweak the background color of a specific page. I attempted setting the HTML as the background color, using !important, but unfortunately, it didn't yield the desired result. The same goes for trying to set the background color of *.

The issue mainly lies at the bottom of the page, which requires fixing. My assumption is that this problem surfaced due to me adding a margin-bottom to the last container, although it's necessary. Appreciate any assistance in resolving this!

Furthermore, it seems like I'm encountering a similar challenge on other pages too.

https://i.stack.imgur.com/XLF1t.png

.bods {
  background-color: #555B6E !important;
  font-family: orpheuspro, serif;
  font-style: normal;
}

.container-1 {
  border-radius: 20px;
  background-color: #50354d!important;
  max-width: 700px;
  min-height: 500px;
  margin-bottom: 30px;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 120px 75px 0px 50px;
}

.container-2 {
  border-radius: 20px;
  background-color: #50354d!important;
  max-width: 700px;
  min-height: 500px;
  margin-top: 132px;
  margin-left: auto;
  margin-right: auto;
  padding: 120px 75px 0px 50px;
}

.container-3 {
  border-radius: 20px;
  background-color: #50354d!important;
  max-width: 700px;
  min-height: 500px;
  margin-top: 132px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 30px;
  padding: 120px 75px 0px 50px;
}

.paragraph-1 {
  margin-top: 40px;
  margin-bottom: 0px;
  color: whitesmoke;
  text-align: center;
}

.heading {
  text-transform: uppercase;
  margin-top: 100px;
  text-align: center;
  color: whitesmoke;
}

.paragraph-2 {
  margin-top: 40px;
  color: whitesmoke;
  text-align: center;
}

.paragraph-3 {
  margin-top: 40px;
  color: whitesmoke;
  text-align: center;
}


<html>
<body class="bods">
  <br>
  <br>

  <br>

  <div class="card-body shadow p-3 mb-5 rounded">
    <h1 class="heading">
      Heading 1
    </h1>
    <p class="paragraph-1">Text 1</p>
  </div>


  <div class="card-body shadow p-3 mb-5 rounded">
    <h1 class="heading">
      Heading 2
    </h1>
    <p class="paragraph-2">Text 2</p>
  </div>


  <div class="card-body shadow p-3 mb-5 rounded">
    <h1 class="heading">
      Heading 3
    </h1>
    <p class="paragraph-3">Text 3</p>
  </div>
</body>
</html>

Answer №1

I would appreciate more information regarding the issue you are facing.

It appears that classes "container-1, container-2, container-3" are not present in the html code. However, I am able to modify the background color of other classes.

https://i.stack.imgur.com/UPM2n.png

Answer №2

One issue that arises is the presence of a class called .bods within the body tag, which takes precedence over the styling defined for the body element.

In addition, the .bods class has been designated with an !important rule, requiring a specific approach to override it:

body.bods {
  background-color: red !important;
}

An alternative solution would be to modify the definition of the .bods class if you have access to the relevant file:

.bods {
  background-color: red !important;
  font-family: orpheuspro, serif;
  font-style: normal;
}

Consider implementing the following CSS snippets as well:

/* Additional CSS Snippets */
.body.bods {
  background-color: red !important;
}

/* Include more custom styles below */
.container-1 {
  border-radius: 20px;
  background-color: #50354d!important;
  max-width: 700px;
  min-height: 500px;
  margin-bottom: 30px;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 120px 75px 0px 50px;
}

... // More CSS code snippets can go here

Make sure to customize the provided HTML and CSS snippets according to your specific requirements and preferences.

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

JavaScript function for automatic scrolling to the bottom of the page is not functioning as expected

I'm working on incorporating a terminal/console feature into my website. I came across the JavaScript functions for scrolling down a page, namely window.scrollTo(0,document.body.scrollHeight); and window.scrollTo(0,document.querySelector(".fakeSc ...

Is ngwebdriver compatible with Appium for testing iOS applications?

Our team is currently working on a Cordova angular mobile app and looking to implement automation testing. Since we are not well-versed in javascript, we prefer not to use the protractor tool. Is it possible to utilize ngWebDriver with appium and seleniu ...

Conceal the sidebar menu by clicking anywhere outside of the menu bar or the designated button

I attempted to create a menu similar to the semantic UI, but so far I have only been able to click the menu button to open and close the menu. I am using a toggle class to display the sidebar, but I'm unsure if this approach is entirely correct: < ...

What is the best way to determine the P/E ratio for a specific stock?

Need help with a formula calculation. I have the value for net worth, but I am having trouble iterating over the EPS values and multiplying them by the shares held. Can anyone suggest a solution? Thank you! You can find the Plunker here <div&g ...

How come the pop-up isn't displaying in the middle of the screen?

I have encountered a positioning issue while using a semantic modal with Angular. The problem arises when I try to display the modal as it does not appear in the correct position. Below is the code snippet from my HTML file: <div class="ui modal"> ...

Swapping out a section of text with AngularJs

Can you provide guidance on how to replace a string in AngularJs? I would like to achieve the following: {{string.replace('some', 'thing')}} Appreciate any help! ...

Make multiple images in one row resize proportionally instead of wrapping them to the next line

My phone's screen is small and I want the three images to remain in the same row. In case they don't fit, they should shrink proportionately to maintain alignment (refer to image at the bottom). Consider the code snippet below: <div id="exam ...

Using AngularJS to create interactive popups within leaflet maps

My map uses leafletjs to create markers such as ev124, ev125, and so on. In addition, there are links with a key attribute like <a ng-click="popup(evsi)" key="124">link</a> Using angular, I extract the key value this way: $scope.popup= funct ...

Having trouble implementing button functionality in a web app using JS, jQuery, HTML, and CSS along with an API integration

I am currently developing a web search engine that utilizes the Giphy API... However, I've encountered difficulties with the button function. I have created buttons to modify the page format and adjust the number of search results displayed.... The We ...

Ways to transform a poster into a clickable link in an HTML video

I am currently working on embedding an mp3 audio file in a browser, along with an accompanying image and a URL for redirection upon clicking. To achieve this, I have placed the mp3 file within a video tag and designated the image as a poster using the foll ...

Trouble loading nested view template

I am currently working on developing a tabbed interface that maintains state using AngularJS, UI Router, and UI Router Extras. I have been referencing this example as a guide. Everything functions correctly if I do not include a nested view with an abstra ...

Delete the final character from the value stored in the map

After retrieving data from the backend, I receive: {"Item":{"userEmail":"b","Username":"bUsername","Push":"sdsdsd","Password":"sdsds","Buddy":{"datatype":"SS","contents":{"Drake":"Drake","Ola":"Ola","b":"b","d":"d"}}}} Utilizing Object.Keys, I filter ...

Perform a search within an iframe

Despite the fact that iframes are considered outdated, I am attempting to create a browser within an HTML browser. I have implemented a search bar that opens the typed input in a new window which searches Google. However, I would like to modify it so that ...

Having trouble with ng-repeat not functioning properly. It seems like there may be a scope issue causing the problem, but

Looking at the div structure below: <div id="chatrooms" ng-controller="TableMsgController"> <section id="chatroom"> <div id="messages" > <ul> <li ng-repeat="entry in seenMsgs">{{entry.msg}}</li> </ul&g ...

Tips for locking the button in the navigation bar while scrolling

I noticed that when I have 6 fields in my navbar, with 5 of them being links and one as a dropdown, the scrolling of the page causes all fields to remain fixed except for the dropdown field.Check out this image description for reference https://i.stack.im ...

Can Angular Directives be declared solely in HTML code?

(Linked to my previous question on Programmers.SE: ) It becomes cumbersome to write JavaScript boilerplate in a separate file just to create a Directive when wanting to reuse a few lines of HTML. I wish there was a way to define a Directive directly withi ...

What is the best way to ensure HTML validation during a pull request?

Are there any tools available to validate all specified files in a pull request? I have previously used Travis CI for testing and am now searching for a similar plugin focused on validation rather than tests, such as W3C validation. ...

Updating Array Values in AngularJS based on Input Text Box Modifications

In my application, there is a text box that looks like this - <input type="text" class="form-control" id="inputID" name="ItemId" ng-model="inputItemId" ng-required="true" ng-blur="addValueToArray(inputItemId)"/> The user has the ability to add or r ...

Troubleshoot: Issues arising when loading DataTables using AJAX with MYSQL

For some reason, I'm receiving an invalid JSON response from this code. The objective is to showcase SQL data in a table with search and sort functionalities using https://datatables.net/. Can you pinpoint where the issue might lie? GET.PHP $mysqli ...

Adjust grid percentages using jQuery Mobile

Struggling with creating a grid that includes form drop-downs and text boxes. Desiring the grid to be divided into sections of 25%, 50%, 25%, but having trouble understanding the grid system syntax. <fieldset class="ui-grid-b"> <div clas ...