Could someone please assist me in identifying the issue with my CSS file? I am having trouble getting the primary color to display correctly in my HTML

I have incorporated a CSS style sheet found here: https://codepen.io/lorenzoyeung/pen/zYqxNQg

However, when I attempt to implement the following code snippet,

background-color: primary;
  border-color: secondary; 

the changes do not take effect. Can anyone help me understand why? This CSS sheet is intended for use in my plotly web application.

Answer №1

Experiment with the RGB model by utilizing a syntax such as: background-color: rgb(0, 255, 0) or incorporating color names like: background-color: red

Answer №2

If you want to utilize CSS variables, remember to use the following syntax: var(--variableName). In your case, ensure to apply the correct syntax as demonstrated below:

background-color:var(--primary);
color:var(--secondary);

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

Cross-domain scripting with JavaScript

I currently manage 2 subdomains securityservices.example.com workstations.example.com All workstations are associated with the workstations.example.com One of the workstations, known as WS789012 on the domain, is fully qualified as: WS789012.workst ...

How to Toggle the Submit Button Using jQuery

I have implemented a feature using jQuery to disable the submit button and display a loading image. Here is how I have set it up: The HTML structure for the submit button looks like this: <div id="registerbtn" name="registerbtn"> <input typ ...

Troubleshooting issues with adding rows to an HTML table

I want to include two buttons at the top of my page: Save and Cancel. These buttons should only appear after clicking the Submit button on the Customer Information panel. However, when trying this, the Customer Information panel is pushed down while I al ...

What causes the form to vanish when using the ngFor directive?

Whenever I use the ngFor directive within a form tag, the entire form seems to disappear. Does anyone have any advice on how to resolve this issue? <form #myforms="ngForm" *ngFor="let i of editaddress"> <div class="p-3 p-lg-5 border"> < ...

Using CSS to disable an image map in conjunction with dynamically adjusting CSS styling

On the desktop version of the website, there is an imagemap implemented. However, when the site transitions into tablet or mobile view, the imagemap should be disabled to allow for a simpler navigation area to be displayed. I attempted to use the following ...

Highlighting table rows on mouseover using CSS

I am trying to add a hover effect to my table rows, but when I apply the CSS styles for this behavior, the rows start wrapping. Here's a comparison of how the table rows look before and after applying the styles. You can see the wrapping issue in the ...

What is the best way to add an image to a question or answer in a JavaScript quiz?

I'm in the process of designing a quiz that revolves around using images as questions or answer choices. For example, presenting an image of a cat and asking the user to select the corresponding 'cat' button. Unfortunately, my attempts to i ...

Discover the method to retrieve the month name from an HTML Date input value

Here we have a date input field <input id="customer-date" name="customer-date" type="date" required> Accompanied by this script const customerDate = document.getElementById('customer-date').value; const dateHandler = document.getElementB ...

How can I create a table using a loop and an onclick function for each <td>?

I have written code to create a table in PHP using a loop. I want to add an onclick function to each cell so that when a particular cell is clicked, the background color changes. However, I am encountering an error. Am I doing something wrong? <head& ...

two divs side by side with adjustable sizes

Is there a way to achieve a typical forum post layout with user info on the left and the post itself using CSS? I tried wrapping two divs around another div and using float, but encountered an issue where the floated div remains on the left instead of next ...

Choose Default Value in Drop-Down List in AngularJS when Page Loads

Within the realm of Angularjs, there exists a DropDown: <select ng-model="category" ng-change="categoryChanged(category)" class="form-control" data-ng-options="category as category.name for category in categories"> <option value="">Se ...

The three.js element is not appearing as expected on my webpage

Struggling to implement three.js into my HTML project Here's the HTML code for the canvas: https://i.sstatic.net/8uuN7.png And here is the JS code: https://i.sstatic.net/XYpk5.png Unfortunately, I'm encountering an error and the cube isn' ...

Tips for aligning an image list marker for perfect vertical text centering

When using the CSS property list-style-image, how can I align the 'A' words in the image to the center of the check marks? ...

Retrieve information from a Django model in mysql based on user input

I am trying to retrieve data from a Django model (stored in MySQL) based on user input. Essentially, I have an HTML search bar where users can enter a value, which should then fetch related data from the Django model and display it on another HTML page. ...

Conceal the input field prior to making a selection from the dropdown menu

I have implemented a drop-down menu for selecting dependencies, similar to how it functions in JSFiddle. $('#user_time_zone').on('change', function() { dateCalender = $(this).val(); if (dateCalender == 'Single Date') { ...

What is the best way to extract a list of distinct tags from an HTML document?

Is there a digital tool or basic vanilla Javascript code that can generate a comprehensive list of all the unique HTML tags present in an HTML file? I'm interested in this for the purpose of resetting certain default styles, and I want to ensure that ...

Tips for adjusting the scrollbar in Tailwind (next.js/react)

Having trouble changing the appearance of my scrollbar in a single page application using Tailwind (react/next). I've attempted to create custom CSS for the first div in my index file, like so: <div className="no-scroll"> <<< ...

The fading effects are not functioning as expected in the following code

Hey there, I'm not the most tech-savvy person, but I managed to come up with this code for page redirection. Unfortunately, I couldn't quite get the fade out and fade in effects to work properly when executing it. If anyone out there can help me ...

What is the best way to center align a card using Bootstrap 4?

<div class="container"> <div class="row align-items-center h-100"> <div class="col-6 mx-auto"> <div class="card bg-white mx-auto" id="maincard"> <div class="card-body"> ...