Targeting child elements with CSS selectors

In my ecommerce software, I have a menu that I want to customize by making the main categories bold.

I have attempted various methods, including the ones shown below, but I am struggling to target the correct elements (specifically those in capital letters "COLLECTION" and "CATEGORIES" as shown in the image)

li.ty-text-links__item ty-level-1
{
    font-weight:bold;
}

ty-text-links__item ty-level-1 > a {
    font-weight:bold;
}

https://i.sstatic.net/18AXu.png

Answer №1

The element is not receiving the intended styles because you have overlooked the . preceding the ty-level-1 class in your CSS code.

li.ty-text-links__item .ty-level-1 {
    font-weight: bold;
}

.ty-text-links__item .ty-level-1 > a {
    font-weight: bold;
}

Answer №2

Have you considered targeting the anchor link directly in this way:

a.ty-text__a {
    font-weight:bold;
}

Alternatively, you could do it like this:

.ty-text-links__item a.ty-text__a {
    font-weight:bold;
}

Another option would be to try this approach:

.ty-text-links__item > a {
    font-weight:bold;
}

Answer №3

Following Marcos' suggestion, I have successfully implemented the dots in this manner.

Apologies for my lack of knowledge with the question.

.ty-text-links__item .ty-level-1 > a {
    font-weight:bold;
} and

Answer №4

Check out this suggestion

li.ty-text-links__item.ty-level-1 a.ty-text-links__a {
font-weight:bold;

}

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

How can I show the configuration in Laravel?

After updating my pages to utilize an extended header for consistent content across all pages, I encountered an issue with the footer configuration. Whenever I attempt to retrieve a configuration from Laravel, it appears as normal text instead of being pro ...

Double Marker Challenge in Brochure

I am currently using Leaflet in conjunction with VueJs. I have encountered an issue where a double marker is appearing at a specific location when I add a marker: The code responsible for this behavior is as follows: mounted() { this.map = L.ma ...

What is the best way for me to insert a paragraph between two lists?

Is it possible to insert a paragraph in between lists even though it's not allowed? Here is an example of the code: <ol> <li>One</li> <p>Paragraph 1</p> <li>Two</li> <p>Paragraph 2</p ...

Steps for updating images and text on a live webpage after launching the web application

I added an image to a jsp file. The image, named kid.jpg, is downloaded and stored in the /resources/images folder as shown in the code snippet below. <li style="background-image: url('resources/images/kid.jpg');"> Now that my web app is ...

What is the best way to determine the width of tables - in the HTML code or using a CSS class?

I recently came across some advice suggesting that a website should still be able to function properly even if the CSS files are not loaded. What approach do you think would work best in this situation? Would it be more effective to use <table width=50 ...

Shifting text higher to the <h1> tag using CSS

I'm currently attempting to move the paragraph header closer to my h1 title. I'm struggling with incorporating the position function and have tried using padding without success. On the image, I am aiming to position the text "Where every connec ...

Interested in customizing the hover color of the header links in WordPress?

I'm currently working on customizing the hover color of the links in my WordPress header created with Elementor Page Builder. I tried several CSS solutions by inspecting elements and adding them to the custom CSS section in WordPress, but none seemed ...

The Zurb Foundation has a multitude of redundant CSS entries

I have been utilizing Zurb Foundation for a while now, with a bower + compass setup as outlined in the documentation here. Recently, I encountered an issue where a specific page was loading slowly. Upon investigating, I discovered that there were numerous ...

Button that triggers HTML Audio play when clicked

Is it possible to have audio play when Button 1 is clicked, but then pause or stop if Buttons 2 or 3 are clicked instead? <a href="#" class="button1">Button 1</a> <a href="#" class="button2">Button 2</a> <a href="# ...

The dominance of CSS over other attributes in styling

Imagine having a main body text div and a navigation div for a website. What if you want to make links in the body text green instead of blue, but have the links in the navigation div be red? If you use CSS to make links green, then all links turn green. ...

`The Conundrum of Basic HTML Parsing`

Hello, I am currently working on extracting professor names and comments from the ratemyprofessor website by converting each div into plaintext. The following is the structure of the div classes that I am dealing with: <div id="ratingTable"> <div ...

Create a personalized preview image using specified parameters

Whenever I share a link to a specific location on Google Maps, the preview image of that location automatically appears, as shown below: https://i.stack.imgur.com/waBnb.png I have some knowledge about adding a preview image using the <meta> tag in ...

Alert displayed at the center of the browser when the value surpasses the specified number

My webpage retrieves SNMP data using PHP and displays it with HTML, color-coding the values. I want to add a pop-up alert when a value exceeds a certain number. I have attempted different jQuery solutions without success. The PHP code to get the value: ...

Tooltips envelope around themselves

Several paragraphs contain tooltips, but some of them break onto a new line instead of staying within the text. <div class="row"> ... </div> Fiddle: https://jsfiddle.net/LhjmLw8k/29/ The issue is that certain words like "Trasimeno" and ...

The backgroundImage function is having trouble locating the specified URL path

I'm struggling to set a backgroundImage because it's not recognizing the local path URL. Here is my code snippet: import { makeStyles } from '@material-ui/core/styles'; const loginWrapperStyles = makeStyles(theme => ({ image: { ...

Adding JSON data to an HTML document

Seeking guidance on how to efficiently parse and display information from a JSON file consisting of 3 objects onto a widget. Unsure of the best approach to achieve this task. Any suggestions or methods would be greatly appreciated. Widget Structure: < ...

Incorporating orientation settings within a media query using MUI

In my current project, I am utilizing MUI in conjunction with React. To specifically style the iPad resolution using MUI breakpoints, I have implemented the following code snippet: contentBox:{ width:"10%", paddingLeft:"10p ...

Ext.ux.TDGi.iconMgr is a cutting-edge plugin designed specifically for the latest version of

Has anyone successfully migrated the Ext.ux.TDGi.iconMgr plugin to ExtJS 4? (http://tdg-i.com/44/extuxtdgiiconmgr...-icons-and-css) ...

The attempt to transfer the image to the newly established file was unsuccessful

Whenever I try to upload an image to a file named 'uploads' within the same directory as my PHP files, I keep encountering an error message indicating an 'Undefined index'. Can someone explain what this error means and provide a solutio ...

React component with element style declared in module.css file and conditional state

I'm in the process of developing a mobile dropdown feature for a React web application. I am looking for guidance on the proper syntax to use when incorporating multiple classes into a React element. My goal is to apply styles from an imported module ...