15,493 questions
3 votes
2 answers
124 views
Is there a way to target a pseudo-element in CSS by its class?
I am looking to construct CSS to target this element... <input type="button" pseudo="-webkit-media-controls-play-button" aria-label="play" ...
1 vote
3 answers
81 views
Targeting element which is has not a parent with :not(custom-component)
I am trying to target a paragraph only if it is not inside the custom component my-component. like this: // Style all elements that are NOT inside my-component :not(my-component) *{ color: red; } ...
3 votes
1 answer
103 views
clicking a button with JavaScript using a class and anchor text, rather than ID
I am trying - and failing - to write JavaScript to click this button: The HTML for the button varies depending on the page Example 1 from this page: <span class="a-button-text" aria-...
0 votes
0 answers
28 views
How to select the nth child element that contains a specific attribute in CSS [duplicate]
Below is my HTML code that showcase the problem. Without modifying the HTML structure or adding a class is it possible to select the 3rd span.chatbot-bot-response-inner that contains for example img[...
-1 votes
1 answer
54 views
Why does my image overflow with a defined max-width but works fine with a defined width? [closed]
When I have the width style of an image defined to be 100% of the parent then the image does not overflow. But, when I define the max-width to be 100% of the parent then it overflows. Here is my ...
0 votes
0 answers
56 views
PostCSS parent Selector is adding :is() pseudo after compilation and not producing compatible css
I have just migrated from SCSS to PostCSS and encountered only one issue I cannot resolve. The issue concerns how to alter a the styles of a nested element when its parent has a specific class. The ...
6 votes
1 answer
150 views
CSS nth-of-type; but how to only effect types directly in series
Let's say we have a list of items, with splitter elements (<h3>), for example dates : <h2>Big Header</h2> <div id='container'> <h3>Week Title A</h3> <...
1 vote
1 answer
70 views
Unexpected variable resolution order in CSS with var/property nesting [duplicate]
My goal is to have an architecture where the shadow is defined once, but the color changes depending on HTML attribute data-color-mode. Note: code provided is just for the isolated problem ...
0 votes
1 answer
65 views
Hide a ::before overlay when a parent's attribute changes, after solving a duplicate pseudo-element issue
I'm developing a custom user stylesheet for YouTube to add a "WATCHED" overlay to video thumbnails. My main objective is: The overlay should be visible on any video that has been watched, ...
3 votes
3 answers
135 views
Is it possible to select the first row in a table with CSS?
Given: <table> <caption>Table Title</caption> <thead> <tr>...</tr> </thead> <tbody> <tr>...</tr> </tbody> </table&...
3 votes
1 answer
108 views
CSS selector computed aria name
Is it possible to select via a CSS selector (or xpath) an element based on its computed aria name (=accessible name)? For instance for buttons it is computed like The button has an accessible label. ...
1 vote
1 answer
83 views
How to select all but the last-child, unless the last is also the first
Not that two lines versus one is an issue; but I'd like to learn if there is a more concise way of selecting all but the last-child unless the last-child is also the first-child or only-child, in ...
1 vote
1 answer
91 views
I can't select the css element to data scrape in R. How do I format it to select the information?
I am learning to scrape data and using the website https://quotes.toscrape.com/ as a training dataset. When I try to collect the about section links, I get this error: Error in html_attr(html_elements(...
0 votes
3 answers
57 views
Is there a way to stack a pseudo-element *behind* its <p> parent's text gradient fill?
Here is my snippet. The <p> is the text "Cool CDs", which appears as a gradient-filled text (with the use of background-clip:text). p::before is a slightly shifted-down stroke that I ...
0 votes
0 answers
12 views
CSS override issue: .abnormal class not overriding .plan-box div padding [duplicate]
I'm working on a pricing section where each plan is inside a `.plan-box`. All direct `<div>` elements inside `.plan-box` have a general style: ```css .plan-box div { padding: 15px; ...