806,180 questions
Score of 2
1 answer
99 views
How to override styles of React component with vanilla extract?
How can I ensure style rules for extended component take precedence over style rules for the component I am extending using vanilla extract?
Assuming code like this:
// my-component.css.ts
import { ...
Score of 1
1 answer
112 views
How do I fix main and footer auto align in grid display?
This is my first time coding, but I've recently been coding a personal indie website with css and html and I'm kinda stuck on how it keeps autoing to overlap. I can't quite fix it. I've tried messing ...
Score of -3
2 answers
99 views
When using a negative translate, how do you eliminate the extra space in the DOM from the original item position?
I'm trying to implement a Solitaire game as a person project, and am using a negative translateY() value to have the cards stack on top of each other. (I had previously been using negative margins, ...
Score of 2
1 answer
174 views
Why does changing an attribute in JavaScript not affect my CSS attribute selector?
I'm trying to dynamically create buttons in JavaScript, add them to a div, and then use CSS attribute selectors to change their colors, opacities, and positions
But the CSS part doesn't work, nothing ...
Score of 0
2 answers
311 views
Javascript if statement only runs once [closed]
I'm trying to create a mockup feature where you click on a tab and it pulls down a menu, and when you click on the tab again it goes back up. I managed to get it to work, but the Javascript only runs ...
Score of -7
1 answer
120 views
Should I put all the HTML styles in a root directory? [duplicate]
I've been learning HTML/CSS/JS in order to build a small website. I find myself copying/pasting different styles and font import commands into most of my index pages separately. This felt repetitive, ...
Score of 1
1 answer
108 views
image getting cached on an <img> tag but not on background-image on a <button> tag [closed]
I don't understand why, but there is an image (`pfpFrame.png`) that works correctly when placed in the `src` of an `img` tag, yet fails to appear when set as the `background-image` of a button.
This ...
Score of -4
1 answer
177 views
How can I control scrolling in a website?
I am trying to make a personal website for myself, and I wanted to control the scrolling, so that after the first page, the user has to stop at a pre-determined point on the page. The problem is it's ...
Score of -3
0 answers
132 views
When building and serving a React project, CSS classes are loaded in the wrong order [closed]
I have a React/-DOM (both ^18.2.0) project which I build with Yarn (1.22.19) and react-scripts (5.0.1).
Within this project, I have a self-written UI library, which is also written in React (only ...
Score of 0
0 answers
101 views
Why is the content of a <style> element emptied (WebI)?
In SAP BusinessObjects BI Platform 2025 (Web Intelligence), I use a cell with "Read contents as" set to HTML. The server only renders HTML elements that are on an allow list of permitted ...
Score of 1
1 answer
144 views
Can CSS anchor positioning be scoped per component without generating unique anchor names?
I'm experimenting with CSS Anchor Positioning for dropdowns.
I have several identical components on the page, and each button should anchor only the dropdown inside the same component.
For example:
&...
Score of 1
2 answers
139 views
Using CSS with XML to align table header cells with table body cells
I have a series of XML documents using HTML element type names for tables (table, thead, tbody, tr, th, td).
The file has a table with four columns. If I set the column widths like this:
th:nth-of-...
Score of -6
0 answers
122 views
CSS and JavaScript not applying on my localhost [duplicate]
I have a problem on my Macbook Air M5, I installed homebrew with HTTPS and PHP, I created a new bootstrap project, but when I load it in the navigator, it loads the CSS and JavaScript but it does not ...
Score of 1
0 answers
165 views
Image spacing issue in div [duplicate]
I added a image with 30% of the div and there is a lot of spacing to the right but it has a inline-block so I don't understand why its has that spacing I tried using gap but that didn't work.
html:
....
Score of 2
1 answer
135 views
How do I align a `position: absolute` `span` by its baseline/cap?
I want to align a span to the bottom-left- or top-right-hand corner of a div. I could do this:
.container {
position: relative;
width: 100px;
height: 100px;
border: 1px solid ...