Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
53 views

I’m working with the following code: <div style="--w: 30px;"></div> And I’m testing two expressions: Test Case 1 calc(30px / 720px * 100vw) Test Case 2 calc(var(--w) / 720px * ...
-1 votes
2 answers
143 views

I'm trying to set the width of the striped area in my drawing below, so that it falls within the bounds of the site content. The width of the content is 80%, with a maximum width of 1080px, and ...
1 vote
1 answer
2k views

We have a design system that comes with a number of CSS custom properties for colors, e.g.: :root { --color--blue-1: oklch(88.6% 0.023 238); } We're using the relatively new color format oklch. Now ...
1 vote
2 answers
366 views

I would like to use the following calculation in the width and height of an element: (1 / 0.65) * 100, then the % sign So that the width & height are set to 153.85%. However I believe the first ...
-1 votes
1 answer
141 views

I know that I can use aspect-ratio to make the height of an element equal to a specific fold/portion of its own width, for example aspect-ratio: 1 / 2 will make the height of the element twice as much ...
0 votes
2 answers
291 views

I try to build a website with a color picker. For that, I would like to use some sort of semicircle with which you can choose the hue and a triangle with which you can choose the saturation and ...
0 votes
0 answers
59 views

Is there a way to convert a unit into another without using JavaScript? I thought when I divide a <length> with another <length> unit, the result would be <number>. Such as calc(...
Hao Wu's user avatar
  • 21.6k
0 votes
1 answer
221 views

I want to make a hover effect over a p-tag, when hovered the background should get darker. I used filter:brightness(85%) but this made also the text darker. Here is my css. :root { --my-color:193 55% ...
-4 votes
2 answers
141 views

I'm currently trying to write code that centers a website for which the content is exactly 895 pixels wide, and I want it to be centered. So, I'm trying to write the following in CSS: body { ... ...
LN73's user avatar
  • 3
-1 votes
1 answer
833 views

I found a dynamic way in pure css to reduce the line-height as the font size increases by using a series of nested clamps. Essentially we ascertain the font size using the em unit and then add the ...
Walrus's user avatar
  • 20.6k
1 vote
2 answers
542 views

My goal is to create a absolutely-positioned circle with radius equal to the viewport's (sv*) diagonal length. I tried calculating the diagonal length of the viewport based on the width and height ...
jwseph's user avatar
  • 590
4 votes
2 answers
924 views

How do I recalculate a new value of a CSS variable (custom property) in a sub-element using calc() to modify the value inherited from a parent element? This doesn’t work: div { height: var(--foo)...
0 votes
1 answer
132 views

I'm building a page and, in other to make it responsive, I'm trying to adjust some values based on the viewport width. In particular, I have a DIV that I want to split in 2 columns. I'd like those ...
carlosV2's user avatar
  • 1,439
1 vote
0 answers
115 views

I'm trying to extract the values of CSS transform strings using this regular expression (\w+)\(([^)]*)\) like translateX(10px) or translateY(calc(-50% - 100px)). It works great on simple transform ...
1 vote
1 answer
766 views

I'm trying to change element's opacity based on how wide the browser's window is in a continuous manner. Ideally, I would like to get a unit-less value from calc by dividing current viewport's width ...

15 30 50 per page
1
2 3 4 5
...
15

AltStyle によって変換されたページ (->オリジナル) /