CSS - Implementing two stylesheets sequentially in an Opencart website

Currently, I am encountering a frustrating issue on my website. The CSS files are loading in a peculiar order - first the default styles, followed by my custom overrides in luke.css. This results in a brief display of cream color on the left sidebar before being replaced by my desired styles. You can witness this behavior by visiting MY WEBSITE HERE.

This is a new problem for me! To ensure easy upgradability of the theme on OpenCart, I designed the 'child' stylesheet rather than modifying core files.

If you check out the Fiddle of a snippet from header.tpl file below, it might help identify what's causing the issue.

Initially, I suspected that the issue stemmed from having two stylesheets consecutively. Despite merging them together, the problem persisted [no solution].

Next, I considered the possibility of the CSS files' order in the header causing the problem. I rearranged them with luke.css placed last, but unfortunately, it did not resolve the issue [no solution].

Although there is a LESS compiler available on the OC dashboard, I am unsure about its usage and advantages based on my current code. If you have any recommendations regarding compiling with a pre-processor, please share your insights.

Answer №1

Your webpage has a stylesheet placed at the bottom of the page, just before the closing </body> tag. This particular stylesheet is responsible for setting the background color of your page to white.

The issue here lies in the fact that the browser needs to load a substantial amount of JavaScript before it reaches the end of the body. As a result, it initially renders the entire page with a different background color only to realize it needs to change it later on.

To resolve this problem and optimize your webpage's performance, consider moving this stylesheet (as well as any other stylesheets) inside the <head> section, prior to any script tags.

Answer №2

Your theme.css and editor_settings.css files are containing javascripts that could be causing a blockage in loading. To fix this issue, try rearranging your assets.

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

What exactly is HTML cloud storage all about?

As I work on developing an app through phonegap, one question that comes to mind is the possibility of storing information online. For instance, if there's a number variable that increases when a button is pressed, can this value be saved somewhere an ...

Is there a way for me to make my navigation fill the entire height of the header?

I am trying to create a navigation menu within a header div where the list items are displayed horizontally inside a ul element. I want these list items to be 100% the height of the header. Despite trying to set the height to 100% on various elements such ...

Extracting Data from JSON Using Vue.js

I am facing an issue with extracting data from a JSON file using Vue.js. Below is the HTML and JSON data along with the script. Any help would be appreciated. <!DOCTYPE html> <html> <head> <title>Vu ...

What is the best way to conceal Bootstrap accordion content when first loading my single-page application?

I am currently developing a single page application for an ESP32 device. I have chosen to keep all the content in one document as there is not a lot of information to display. My approach started with using the collapse class from Bootstrap 4.1.2. While i ...

Tips for concealing the "maxlength" attribute in HTML

Here is the code snippet I currently use on a signup and login form to restrict users from entering more than a specified number of characters: $( "#limit1" ).attr('maxlength','11').on('input', function() { if ($(this).val(). ...

Prevent scrolling in a full-screen modal using CSS

I came across a beautiful fullscreen modal that is purely based on CSS. The only issue I encountered was that the modal isn't scrollable. I attempted various solutions but haven't been successful. Here's the script I am using: ...

Challenges with text in a Bootstrap 5 responsive carousel

I'm currently in the process of developing a new website and I am utilizing bootstrap 5. One issue I have encountered is that the text and button within the carousel in the header section do not appear to be compatible. To provide better clarity, I wi ...

How to conceal anchor text within a stretched link using the ::after selector in Bootstrap

I have a card layout where all cards are made clickable with a link using the bootstrap stretched-link class. However, I also added text to the anchor for SEO purposes, even though it doesn't make sense in a card layout. I wanted to hide the text whil ...

Using JavaScript, create a function that accepts an HTML element as a parameter

I have a script with two functions. One function generates a lengthy HTML string, and the other function processes this string as a parameter. function myFirstFunction() { // Generate HTML content return myHTML; } var myHTML = myFirstFunction(); ...

Adding and removing form fields in a table dynamically using AngularJS

I need to dynamically add multiple form fields when a button is pressed, and I want all the fields to be displayed in a table format (each field should have its own space in a <td>field</td> structure). Currently, I am facing an issue where if ...

Tips for preventing DIV elements from overlapping

In the process of creating a CSS design for a SIM game I enjoy playing, a client requested four boxes: two large ones with two smaller ones aligned horizontally in between. Everything was going smoothly until I attempted to add headers to the boxes. The en ...

What is the method for adding a tag within a specific div ID in ExtJS?

I am looking to insert a new tag within existing tags using extjs, based on the div id 'task123', and also trigger an alert message accordingly. Below is the HTML code snippet: <div id="task123"> <div class="msg" id="sample"> ...

Tips for creating responsive images when using two images stacked on top of each other:

One of my challenges with using Bootstrap is trying to place an image on top of another image. Here's the HTML code I currently have: <section id="test"> <div class="row"> <div class="imgbg"><img src="img/bg_pres.png ...

Is a Text-Only View Possible with WebView?

Could someone help me figure out how to restrict a WebView to only load text in my WinRT XAML App? I am looking for a simpler solution than having to download the source and manually editing img tags. ...

Rejuvenate your Bootstrap Accordion with these Settings

Using bootstrap documentation, I have implemented an accordion in my web application with the following code: <div class="accordion" id="accordion2"> <div class="accordion-group"> <div class="accordion-heading"> <a class=" ...

What is causing the lack of HTML formatting in the emails being sent by my PHP contact form?

As I work on creating my custom contact form, I've encountered an issue with the emails not appearing in HTML format during testing. It's puzzling as other sources seem to send HTML formatted emails to my email service provider without any proble ...

store picture in a database: ServiceNow

When filling out a form, I often copy and paste images from webpages into a journal field. However, these images end up being saved as references to the original webpage. Is there a method to save these images directly to the form or record instead? ...

Vertical centering with stacked flexboxes is malfunctioning in Chrome

There is an issue with the following code snippet in Google Chrome: <div class="flex-container"> <div class="flex-item"> <div> <div> <h2>This is a test</h2> </div> </ ...

Is it possible to consolidate three footer widget areas into just one for WordPress?

I'm currently using the Retailer theme for my WooCommerce shop, which has 3 footer widget placeholders set up in a grid layout. However, I want to consolidate these into just one widget that spans the width of the entire main container. I managed to ...

The checkbox appears to have selected values, yet the selected options are not visibly displayed

UPDATE I have been utilizing this specific file in order to dynamically generate a list of tags using the code provided below. import React from "react"; class TagElement extends React.Component{ updateCheck(e){ var v = (e.target. ...