993 questions
1
vote
1
answer
44
views
Sass doesn't remove ":global" pseudo selector during compilation
I have dashboard.scss which contains:
@import '../../src/pages/DashboardPage/DashboardPage.module.scss',
'../../src/ui-components/atoms/Button/Button.module.scss',
'../../src/ui-components/...
1
vote
2
answers
114
views
nested css declaration with pseudo classes in svg style tag not working
I have and SVg and adding tag inside svg and using nested css delcration syntax and wehn using & it gives error of some XMl error ;
first see this html example
<style type="text/css">
...
-1
votes
4
answers
99
views
How to select an <em> html element that is Not a child of any <p> element? [closed]
/* CSS */
em {font-style: italic; background yellow}
::autonomous-not-child-of-a-p-element-? :: em {font-style:normal; background gray}
Given two situations both using <em> differently, in need ...
1
vote
2
answers
183
views
How to have CSS affect every other element that's not invisible [closed]
I'm trying to work with CSS to alternate background color in my divs. I can do that, but which divs display changes. I'd like to be able to alternate only what's currently visible. Otherwise it's ...
0
votes
2
answers
175
views
My css :hover properties do not get removed on mobile when the element is clicked and remain there. And the :active property also works after a delay
I have a button with a :active class instruction to scale down to produce a nice effect, it works fine on pc, but on my mobile device I found that the hover effect remained there after I pressed the ...
0
votes
0
answers
18
views
Cannot provide border after clip-path usage [duplicate]
I have this as required design:
All 6 figures you see are buttons and they must have different title. The design however is almost identical except bg-color. So I created my styled-btn component:
...
0
votes
2
answers
55
views
Why pseudo-elements can't be used as an argument within :has() pseudo-class?
The CSS specs give following reason why pseudo-elements can't be used as an argument within :has() pseudo-class:
Note: Pseudo-elements are generally excluded from :has() because many
of them exist ...
1
vote
2
answers
278
views
CSS ":is()" pseudo-class with relative selectors
I want to style specific "sections that are directly inside the body" and "sections that are directly inside a div directly inside the body" with the ":is()" pseudo-class,...
0
votes
2
answers
54
views
Make all the targets of the ':target' pseudo-class visible
I want to make targets of the :target pseudo-class visible. That is, if the target is a block element, e.g. <p>, that <p> should be outlined; and if the target is an inline element, e.g. &...
1
vote
1
answer
30
views
Pseudo-element z-index issues
I am trying to style lists in my website using pseudo elements to replace the default bullet point. However, the pseudo elements render on top of the dropdown menus in the navigation sidebar for some ...
0
votes
1
answer
652
views
placeholder-shown pseudo class seems not to work on safari
When I use :not(::placeholder-shown), :NOT seems to be not working in safari browsers.
If you are not on safari: Below i added a way to use the safari browser with playwright so you can test it ...
0
votes
1
answer
42
views
Change cursor after two clicks using only html and css?
I know I can change the cursor with one click with the following CSS code:
#slide-arrow-prev:active {
cursor: not-allowed;
}
Is there anyway to change a cursor after two clicks using only html ...
0
votes
2
answers
37
views
How to change pseudo class color to match the color of another class?
I have created a 'block' for a webpage that for example is called 'test-div'.
Test div also has an extra class added to it to change its background color ie.
test-div test-div-bg-bright-gold
test-div ...
0
votes
0
answers
30
views
Attach dynamically a pseudo-class :before to a label inside a component
I want to attach dynamically a pseudo-class :before to a label inside a component whose data come from a db.
I know one cannot manipulate pseudo-class (easily/safely) with JS vanilla. So I think about ...
0
votes
1
answer
36
views
How can I target an :after psuedo-element within HTML controls rendered by an ASP.NET asp:checkbox control? [duplicate]
I have seen code that applies to a simple input-label pair:
HTML
<input type="checkbox" id="toggle" class="checkbox" />
<label for="toggle" class=&...
-1
votes
1
answer
70
views
Applying pseudo-class for a checkbox to a specific sibling
I am looking at realizing a CSS Native multilevel menu for a sidebar without using Javascript (or the setState in my current React implementation).
I have done almost everything, but I am getting ...
0
votes
1
answer
31
views
How to correctly use :valid pseudoclass in mui components to change the border dynamically
I'm trying to change the border color from Mui TextFields,, with createThem from Mui v5, if the input is valid. The border gets set inside ::before and ::after pseudoclasses.
I'm using variant="...
0
votes
0
answers
2k
views
Use :has pseudoclass in tailwind on hover
I have a component with the following structure:
<li key={index} className="custom--item group">
<p className="font-medium mb-2">Person No.{index + 1}</p>
<...
0
votes
0
answers
105
views
Use of CSS pseudo class `:scope` to style elements
From mdn pseudo classes :scope
The :scope CSS pseudo-class represents elements that are a reference
point, or scope, for selectors to match against.
To my understanding a "custom" pseudo ...
0
votes
2
answers
171
views
changing inline css variable using javascript does not reflect on psudo selector content property
writing text using ::after pseudo selector using content property and it's value comes from inline css variable. now on click of the text I am able to change the css variable value ( can be seen in ...
-1
votes
3
answers
60
views
Style element and ::before on hover
I'm trying to use CSS to make the text "Permits Required" and the ::before pseudo-class turn red - the ::before contains an icon.
.knHeader__menu-list-item:hover::before {
color: #...
0
votes
2
answers
41
views
I don't see changes when using :has()
I recently discovered the :has() pseudo-class. When I tried to test it I didn't see any changes. I really don't know why.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
...
1
vote
4
answers
118
views
toggle button and text : working fine, but want to simplified the code as its too long and lengthy
I have some boxes that a lot of information inside them. I want the information less at first and if the user wants to read more information, they click the button "See More". Then if they ...
1
vote
1
answer
307
views
How to use a compound selector in CSS pseudo-class function :host-context(<selector>)
In the :host-context() - MDN DOcs it is stated that:
The :host-context() CSS pseudo-class function selects the shadow host of the shadow DOM containing the CSS it is used inside (so you can select a ...
2
votes
0
answers
39
views
How can I select an input field with value in css? [duplicate]
My input field has a label in the same position as the placeholder. When I click on the input field, the label moves up and appears at the top border of the input field, which looks really nice.
...