Setting Background Color for a Specific Tab in CSS

HTML

<div class="woocommerce-tabs wc-tabs-wrapper">
   <ul class="tabs wc-tabs">
       <li class="paym-plans_tab">
          <a href="#tab-paym-plans">Contract Deals</a>
       </li>
          <li class="simfree-plans_tab active">

CSS

#tabs ul.wooTabs li a.selected, #tabs ul.tabs li.active a, .woocommerce_tabs ul.tabs li.active a, .woocommerce-tabs ul.tabs li.active a {
    background: #52b9e9 none repeat scroll 0 0;
    color: white;
}

Seeking to modify the background color and text color of specific WooCommerce tabs with class .paym-plans_tab active and .simfree-plans_tab active to #52b9e9 and white respectively when the tab is selected. Currently, the provided CSS affects all tabs. Is there a way to target only the tabs I want?

Answer №1

If I have comprehended your question accurately, you simply require something along the lines of the following:

.wc-tabs .active a {
    background: #52b9e9 none repeat scroll 0 0;
    color: white;
}

Naturally, your framework should apply the active class to a tab when clicked, and remove it from the previously active tab.

Answer №2

please take a look at this link

.payment-plans_tab {
  background-color: #52b9e9;
  color: white;
  }

.payment-plans_tab > a {
  color: white;
 }

.simfree-plans_tab > a {
   color: white;
  }


a:hover {
 background-color: red;
}

.simfree-plans_tab {
  background-color: #52b9e9;
  color: white;
 }

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

PHP Implementing real-time dynamic categories

I am working on a project where there are multiple items listed with unique IDs. Each item has corresponding data with the same ID. I want to use JQuery, JScript, and PHP to display options based on the ID of the selected item in real-time. Below is a snip ...

Ways to retrieve JSON data through multiple levels of nested if statements

Currently, I am using CodeIgniter to work on a small project involving creating batch lists. When an admin attempts to create a new batch list, they must input the start date, end date, start time, and end time. The system will then check the database to s ...

Tips for capturing audio on a smartphone browser?

Looking to capture audio in the browser on both iOS and Android devices. What solutions are currently available (as of October 2013)? What is the rate of acceptance of WebRTC by various browser developers? ...

Switch up the Background using .css and jCarousel

I am attempting to create a dynamic gallery using jCarousel and Ajax. The thumbnails are being loaded from a '.txt' file. I am trying to achieve the following effect: When a thumbnail is clicked, the background of the body changes. This action sh ...

How can I convert dates into a different format?

I have various event dates that are stored in the format 20131212 or 20100125, or any date submitted by a user for an event (formatted as yyyymmdd). I have created a function that displays all events for a specific month. However, the date is currently di ...

Creating a diverse layout by dynamically adding divs without achieving uniformity in the grid

I'm working on dynamically generating a grid of divs with a specific size using the code below: function createGrid(gridSize) { var container = document.getElementById('container'); for (var i = 0; i < gridSize; i++) { va ...

Fill in input field based on choice from the drop-down menu - JavaScript

I am facing an issue where I cannot add text inside the text box based on the dropdown selection. For example, if I select option2 from the dropdown, the textbox should be populated with option2. (function() { 'use strict'; setInterva ...

Is there a way to adjust the image opacity of a background using Material UI?

Is there a way to adjust the opacity of a background image using Material UI? I attempted to achieve this by utilizing the makeStyles hook in Material UI. Here is an example of my code: import React from 'react'; import {Box,Typography } from &ap ...

Organize images with overlays to the center of the page

I need help centering a group of pictures (a 3x3 table) on my webpage. I was able to center them before adding image overlays, but now the images are showing up in the top left corner of the page. How can I group and center them, and how do I specify the i ...

Switch between dynamically generated div elements

Currently, I am in the process of developing my own lightweight blogging platform as a way to enhance my skills in PHP and jQuery without depending on Wordpress. The pagination system I have created displays 5 blog posts per page using PHP. However, within ...

Using routerLink for linking to multiple components

Below is the anchor tag provided: <a class="uppercase" routerLink="settings/pressure" routerLinkActive="text-success" (click)="closeModal()" > <div class="pad-btm"> PRESSURE </div> </a> I need to include another route ...

Update overall font size to be 62% for a consistent look across the website

Recently, I developed a browser extension that adds an overlay button to the LinkedIn website. Everything was running smoothly until I discovered that LinkedIn uses a global font-size: 62,5% that completely messes up my design.. https://i.stack.imgur.com ...

Discovering the current page using ons-navigator in Onsen UI

I am currently attempting to determine the page I am on while using the popPage() function with Onsen UI's ons-navigator. I have tried the following methods, but they always return false regardless: this.navigator.nativeElement.popPage().then((page: a ...

The website is plagued by the presence of unwanted hyperlinks

There seems to be unwanted hyperlinks appearing in the text content on my website. Website URL: http://www.empoweringparents.com/my-child-refuses-to-do-homework-heres-how-to-stop-the-struggle.php# Could you please review the 10th point? There are links b ...

Having EventListeners set up across a single CSS class returns null when applied to different types of elements simultaneously

I want to create floating labels that resize dynamically when an input is clicked, similar to modern forms. I am using vanilla JS exclusively for this task. Currently, the setup works with the <input> tag. However, it does not work with the <text ...

Optimal method for streaming and viewing an mkv video captured with ffmpeg in a web browser

Is there a way to stream a video recorded with ffmpeg in a web browser using the HTML5 video tag? I currently have this code on my page, with the URL pointing to a video file (example.mkv) being recorded by ffmpeg. <video class="video-player" controls ...

The function has exceeded the time limit of 60000 milliseconds. Please make sure that the callback is completed

Exploring the capabilities of Cucumber with Protractor has been an intriguing journey for me. As I delved into creating a feature in Gherkin language, outlining the steps and scenarios necessary for my end-to-end tests, a new world of possibilities opened ...

The navigation bar seems to be missing from the page

I am currently working on developing a responsive navigation bar with CSS animation. However, I am encountering some issues when trying to run the code on my laptop. Upon running it, only the checkbox appears while the list of navigation items is displayed ...

Eliminate the Div Attribute once the radio button is activated

I'm just starting out with JavaScript and feeling a bit lost. I came across some code that adjusts the attributes of a Div based on a selection from a dropdown list. Now, I want to tweak it so that it works when a radio button is selected instead. Be ...

CSS to Reverse Align Navigation Bar Text

I'm currently working on my first website and I've encountered a problem with the Navigation Bar. Using CSS rules to align the bar, I noticed that when I apply float:right;, the text floats to the right but ends up aligning backwards on the bar. ...