the background image fails to appear in the div elements when using mobile jQuery

After setting a background image for a mobile page using mobile.jquery, I encountered an issue. When linking to the cdn version of the jquery css file:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css" />

The default css from this file overrides my background settings for content divs. However, removing the css file displays the background image properly on divs without any background set.

I prefer to use the default css file from CDN, but how can I customize the background in my own .ui-body-c class?

The provided css for ui-body-c (built-in from mobile.jquery http://code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css):

.ui-body-c
{
border-top-width: 1px;
border-right-width-value: 1px;
border-right-width-ltr-source: physical;
border-right-width-rtl-source: physical;
border-bottom-width: 1px;
border-left-width-value: 1px;
border-left-width-ltr-source: physical;
border-left-width-rtl-source: physical;
border-top-style: solid;
border-right-style-value: solid;
border-right-style-ltr-source: physical;
border-right-style-rtl-source: physical;
border-bottom-style: solid;
border-left-style-value: solid;
border-left-style-ltr-source: physical;
border-left-style-rtl-source: physical;
border-top-color: #b3b3b3;
border-right-color-value: #b3b3b3;
border-right-color-ltr-source: physical;
border-right-color-rtl-source: physical;
border-bottom-color: #b3b3b3;
border-left-color-value: #b3b3b3;
border-left-color-ltr-source: physical;
border-left-color-rtl-source: physical;
color: #333333;
text-shadow: #ffffff;
background-color: #f0f0f0;
background-repeat: repeat;
background-attachment: scroll;
background-position: 0% 0%;
background-clip: border-box;
background-origin: padding-box;
background-size: auto auto;
background-image: #eeeeee;
}

Answer №1

There are two solutions you can try.

Firstly, consider using the !important declaration in your CSS rules to prioritize them.

Secondly, keep in mind that using background-image: #eeeeee; is not a valid CSS syntax. The correct values for background-image property are url(path/to/image.png), none, or inherit.

To address this issue, create a new file named overrides.css on your hosting server (or any name you prefer), or insert it directly into your HTML page by placing a <style> tag within the <head> section. In this file (or style tag), include the following code:

.ui-body-c {
    background-image: url(path/to/image.png) !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

Ways to access nested div children without using identifiers

To customize the width of a specific div using jQuery, I need to target the following structure in my HTML code. Although parts of it are generated by a lightbox plugin, the part that sets it apart is the unique class "xxxgallery": <div class="xxxgalle ...

What steps can I take to ensure that the content remains intact even after the page is

Hey there, I hope you're having a great start to the New Year! Recently, I've been working on creating a calculator using HTML, CSS, and JavaScript. One thing that's been puzzling me is how to make sure that the content in the input field do ...

Arranging various sections with Bootstrap

I am having trouble arranging my div elements the way I want them to be. First, I want the height of the card to match the height of my title. Then, I want the bottom of my two buttons to align with the bottom of my card. I believe this is achievable but ...

What could be causing the issue of node-sass generated CSS files not loading on the initial GET request?

I've set up a node express app and incorporated sass support for the CSS. However, when I attempt to access http://myhost.com:port/css/whatever.css, the whatever.css file is generated in the express_app_root/public/css directory as expected. The *.scs ...

How do I align the content of table cells to the top of a row using Tailwind CSS?

I'm currently exploring ways to position the contents of a table cell at the top of the row. <tr className="flex-1 items-center align-top"> <td className=" py-1 pl-1 pr-1 text-sm sm:pl-6"> <div classNam ...

CSS animation fails to animate the object

I am encountering an issue with a CSS animation that I am trying to implement for each child within a nav element. Specifically, I am attempting to create a dynamic stock panel. Interestingly, when I add another CSS attribute like color, it works as expec ...

I'm feeling lost trying to figure out how to recycle this JavaScript function

Having an issue with a function that registers buttons above a textarea to insert bbcode. It works well when there's only one editor on a page, but problems arise with multiple editors. Visit this example for reference: http://codepen.io/anon/pen/JWO ...

Alignment of nav-item with superimposed right position

Can someone help me align my navbar elements in Bootstrap 4? I want all elements aligned to the right, except for one that needs to be centered: <ul class="nav navbar-nav"> <li class="nav-item float-xs-right"> <a class="nav-link" ...

Arranging items in a flex container

My goal is to achieve the following layout with flexbox: #box { display: flex; flex-wrap: wrap; flex-direction: row; justify-content: center; justify-items: center; align-items: center; } #spotLight img { width: 15%; height: 15%; } # ...

Tips for arranging several icons alongside containers in a grid format featuring six different boxes

I am struggling with positioning icons outside the boxes in my three column, two row grid layout. There are six containers total, arranged on 2 lines with three boxes on each row. The goal is to have icons displayed inline with the heading next to each box ...

Integrate the element offset into jQuery's offset calculations

I'm new to utilizing jQuery and currently facing a challenge in determining the correct offset for a specific div element within the body. My goal is to make this particular div stick to its position as I scroll down past its designated top offset. A ...

Is there a way to specifically target the MUI paper component within the select style without relying on the SX props?

I have been experimenting with styling the Select MUI component using the styled function. I am looking to create a reusable style and move away from using sx. Despite trying various methods, I am struggling to identify the correct class in order to direct ...

Scroll the page to bring the div to the top position

Currently working on a web page that consists of divs with varying heights and text inside them. I would like to implement a feature where clicking on the text within a div automatically scrolls the page so that particular div is positioned at the top of t ...

CSS3 alternative to width:calc(100% - 10px)

Currently, I am in need of an alternative solution for migrating my CSS file since some CSS3 features are not being rendered properly on QtWebKit yet. The CSS code that I am working with is as follows: .fit { width: -moz-calc(100% - 10px); width: ...

jQuery-powered one-page site - Information in HTML or JavaScript

I am currently learning JavaScript and jQuery, with a strong grasp on HTML/CSS. I am working on developing a single-page front-end website using Bootstrap for layout design. My main focus now is on implementing functionality. Here is the scenario: There a ...

The viewport width in NextJS does not extend across the entire screen on mobile devices

I'm currently tackling a challenge with my NextJS Website project. It's the first time this issue has arisen for me. Typically, I set the body width to 100% or 100vw and everything works smoothly. However, upon switching to a mobile device, I not ...

What is the best way to remove bootstrap when transitioning to a new microfrontend?

Our team is facing an issue with styling when using a combination of React, Bootstrap, and Tailwind. The problem arises when linking our micro frontend to modules that use Tailwind, as the Bootstrap styles persist despite the change. Since both Tailwind an ...

Tips for positioning text within a div element's bottom edge

I'm facing a challenge in creating a footer for a div element that contains a <p> tag. The issue arises when the font size varies, causing the footer to extend outside the box. How can I ensure that it aligns at the bottom of the page with the c ...

I'm currently working on setting up a gallery on the lower part of my webpage, but for some reason, the lightbox2 images are not aligning next to each other in rows. Can anyone

Struggling to align images in a gallery at the bottom of my webpage. They keep appearing on separate lines instead of next to each other. HTML: <section id="galleries"> <h2>Galleries</h2> <article class="img- ...

Scrolling with Jquery window.scrollTo results in the page becoming unresponsive

I'm currently revamping a website that features a header with 100% screen height, but I need it to shrink down to 0px when a user starts scrolling. The issue I'm facing is that once the header shrinks to 0px, the page content ends up slightly abo ...