Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Category: CSS

CSS

CSS: Fix a Scroll-Driven Animation Running Only on First Load

- 21.11.26 - ErcanOPAK comment on CSS: Fix a Scroll-Driven Animation Running Only on First Load

🎨 CSS: Fix a Scroll-Driven Animation Running Only on First Load A CSS scroll-driven animation using animation-timeline: scroll() computes its timeline range from the scroller’s content size at the moment the timeline attaches to an element. If content is added later — images lazy-loading in, or a list populated after an API response — the […]

Read More
CSS

CSS: Fix a Scroll-Snap Point Skipping the Last Item

- 20.11.26 - ErcanOPAK comment on CSS: Fix a Scroll-Snap Point Skipping the Last Item

🎨 Fix a Scroll-Snap Point Skipping the Last Item A horizontally scrolling card gallery built with scroll-snap-align on its children snaps the viewport to each child’s defined alignment point as the user scrolls, but if the container’s own trailing padding creates extra scrollable space past the last card’s snap point, fast momentum scrolling on a […]

Read More
CSS

CSS: Fix a Sticky Header Jumping When a Scrollbar Appears

- 19.11.26 - ErcanOPAK comment on CSS: Fix a Sticky Header Jumping When a Scrollbar Appears

🎨 Fix a Sticky Header Jumping When a Scrollbar Appears `position: sticky` keeps an element pinned relative to its nearest scrolling ancestor, but when page content grows tall enough to introduce a vertical scrollbar for the FIRST time, a browser using a classic non-overlay scrollbar reduces the viewport’s available width by the scrollbar’s own width […]

Read More
CSS

CSS: Fix an aspect-ratio Box Collapsing When Content Overflows

- 18.11.26 - ErcanOPAK comment on CSS: Fix an aspect-ratio Box Collapsing When Content Overflows

🎨 CSS: Fix an aspect-ratio Box Collapsing When Content Overflows aspect-ratio sets a preferred size relationship between width and height, but it isn’t a hard clamp on the box — other layout rules can still win. Inside a flex container, a flex item’s default min-height: auto lets its content push the box taller than the […]

Read More
CSS

CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS

- 17.11.26 - ErcanOPAK comment on CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS

🎨 CSS: Fix a Sticky Header Jittering During Momentum Scroll on iOS A position: sticky header that looks rock-solid on desktop can visibly jitter or flicker during iOS Safari’s momentum scrolling, especially once a backdrop-filter blur is involved, because the browser’s compositor has to repaint that blurred layer on nearly every scroll frame instead of […]

Read More
CSS

CSS: Fix a Grid Item Overflowing Its Track From Implicit Min-Width

- 16.11.26 - ErcanOPAK comment on CSS: Fix a Grid Item Overflowing Its Track From Implicit Min-Width

🎨 CSS: Fix a Grid Item Overflowing Its Track From Implicit Min-Width Grid items, like flex items, carry an implicit min-width: auto that resolves to the content’s own intrinsic minimum size. For an item containing unbreakable content – a long URL, a wide table, a <pre> block with nothing to wrap on – that intrinsic […]

Read More
CSS

CSS: Fix position: sticky Refusing to Stick Inside a Scroll Box

- 15.11.26 - ErcanOPAK comment on CSS: Fix position: sticky Refusing to Stick Inside a Scroll Box

🎨 CSS: Fix position: sticky Refusing to Stick Inside a Scroll Box Sticky positioning computes “stuck” relative to the element’s nearest scrolling ancestor. If any ancestor between the sticky element and that scroll container has overflow set to anything other than visible — including overflow-x or overflow-y alone, added for an entirely unrelated reason like […]

Read More
CSS

CSS: Fix scroll-snap-type Quietly Breaking the Browser’s Own Back-Button Scroll Position Restore on the Page You Just Left

- 14.11.26 - ErcanOPAK comment on CSS: Fix scroll-snap-type Quietly Breaking the Browser’s Own Back-Button Scroll Position Restore on the Page You Just Left

🎨 Fix scroll-snap-type Quietly Breaking the Browser’s Own Back-Button Scroll Position Restore on the Page You Just Left Browsers normally remember exactly how far down a page you’d scrolled before you navigated away, and restore that same scroll position automatically when you hit the back button. A container with scroll-snap-type applied actively pulls its own […]

Read More
CSS

CSS: Fix a Flexbox Child’s min-width Silently Overriding Its Set width Because the Default Was Never Reset to 0

- 13.11.26 - ErcanOPAK comment on CSS: Fix a Flexbox Child’s min-width Silently Overriding Its Set width Because the Default Was Never Reset to 0

🎨 CSS: Fix a Flexbox Child’s min-width Silently Overriding Its Set width Because the Default Was Never Reset to 0 Every flex item has an implicit min-width (or min-height in a column flex container) of auto by default, which the spec defines as roughly the size of the item’s content at its largest unbreakable point […]

Read More
CSS

CSS: Fix a position: sticky Element Refusing to Stick Because an Ancestor Has overflow: hidden Set Somewhere You Didn’t Expect

- 12.11.26 - ErcanOPAK comment on CSS: Fix a position: sticky Element Refusing to Stick Because an Ancestor Has overflow: hidden Set Somewhere You Didn’t Expect

🎨 CSS: Fix a position: sticky Element Refusing to Stick Because an Ancestor Has overflow: hidden Set Somewhere You Didn’t Expect A `position: sticky` element sticks relative to its nearest scrolling ancestor, not necessarily the viewport — and any ancestor between the sticky element and that scroll container with `overflow` set to anything other than […]

Read More
CSS

CSS: Fix a grid-template-columns Track Set to 1fr Refusing to Shrink Below Its Content’s Intrinsic Width Because fr Units Resolve After the Browser Applies Each Track’s Content-Based Minimum, Not Instead of It

- 11.11.26 - ErcanOPAK comment on CSS: Fix a grid-template-columns Track Set to 1fr Refusing to Shrink Below Its Content’s Intrinsic Width Because fr Units Resolve After the Browser Applies Each Track’s Content-Based Minimum, Not Instead of It

🎨 CSS: Fix a grid-template-columns Track Set to 1fr Refusing to Shrink Below Its Content’s Intrinsic Width Because fr Units Resolve After the Browser Applies Each Track’s Content-Based Minimum, Not Instead of It An fr unit in grid-template-columns distributes available space proportionally among tracks, but that distribution happens only after the grid layout algorithm first […]

Read More
CSS

CSS: Fix an @scope Block’s Lower Boundary Silently Excluding the Exact Element You Meant to Style Because the Boundary Selector Also Matched That Target Element Itself

- 10.11.26 - ErcanOPAK comment on CSS: Fix an @scope Block’s Lower Boundary Silently Excluding the Exact Element You Meant to Style Because the Boundary Selector Also Matched That Target Element Itself

🎨 Fix an @scope Block’s Lower Boundary Silently Excluding the Exact Element You Meant to Style Because the Boundary Selector Also Matched That Target Element Itself @scope (from) to (boundary) limits a rule’s reach to elements inside the scoping root but outside anything matching the boundary selector, and that exclusion applies to any element matching […]

Read More
CSS

CSS: Fix a background-image url() Built From a Custom Property Never Loading Because CSS Has No Way to Concatenate a var() Value Into Part of a url() String

- 09.11.26 - ErcanOPAK comment on CSS: Fix a background-image url() Built From a Custom Property Never Loading Because CSS Has No Way to Concatenate a var() Value Into Part of a url() String

🎨 Fix a background-image url() Built From a Custom Property Never Loading Because CSS Has No Way to Concatenate a var() Value Into Part of a url() String A CSS custom property can substitute an entire property value — including the whole url(…) function, assigned once to –icon and then referenced with background-image: var(–icon) — […]

Read More
CSS

CSS: Fix an Absolutely Positioned Element With inset: 0 and margin: auto Not Actually Centering Because Its Parent’s Height Collapses to Zero

- 08.11.26 - ErcanOPAK comment on CSS: Fix an Absolutely Positioned Element With inset: 0 and margin: auto Not Actually Centering Because Its Parent’s Height Collapses to Zero

🎨 CSS: Fix an Absolutely Positioned Element With inset: 0 and margin: auto Not Actually Centering Because Its Parent’s Height Collapses to Zero The classic centering trick — inset: 0 plus a fixed width and height and margin: auto on an absolutely positioned child — relies on that element’s containing block having a definite size […]

Read More
CSS

CSS: Fix a position: sticky Element’s Offset Jumping on Every Scroll Because a Parent Element Has transform Set to Anything Other Than none

- 07.11.26 - ErcanOPAK comment on CSS: Fix a position: sticky Element’s Offset Jumping on Every Scroll Because a Parent Element Has transform Set to Anything Other Than none

🎨 CSS: Fix a position: sticky Element’s Offset Jumping on Every Scroll Because a Parent Element Has transform Set to Anything Other Than none position: sticky calculates its stuck offset relative to its nearest scrolling ancestor, but crucially also relative to whichever ancestor establishes a new containing block for it — and setting transform to […]

Read More
CSS

CSS: Fix a Sticky-Positioned Element Scrolling Away Anyway Because an Ancestor Sets overflow to Anything Other Than visible

- 06.11.26 - ErcanOPAK comment on CSS: Fix a Sticky-Positioned Element Scrolling Away Anyway Because an Ancestor Sets overflow to Anything Other Than visible

🎨 CSS: Fix a Sticky-Positioned Element Scrolling Away Anyway Because an Ancestor Sets overflow to Anything Other Than visible position: sticky sticks an element relative to its nearest scrolling ancestor, but which ancestor counts as scrolling is decided by the overflow property, not by which element the page visually scrolls inside. Any ancestor with overflow […]

Read More
CSS

CSS: Fix a :has() Selector Silently Matching Nothing in Production Because an Older Browser in Your Support Matrix Doesn’t Implement It

- 05.11.26 - ErcanOPAK comment on CSS: Fix a :has() Selector Silently Matching Nothing in Production Because an Older Browser in Your Support Matrix Doesn’t Implement It

🎨 CSS: Fix a :has() Selector Silently Matching Nothing in Production Because an Older Browser in Your Support Matrix Doesn’t Implement It The :has() relational pseudo-class lets a parent selector react to its own descendants — .card:has(img) styling a card differently when it actually contains an image — and shipped broadly across Chromium, Safari, and […]

Read More
CSS

CSS: Fix a clip-path Shape Silently Snapping Instead of Animating Smoothly Between Two Polygons Because They Don’t Have the Same Number of Points

- 04.11.26 - ErcanOPAK comment on CSS: Fix a clip-path Shape Silently Snapping Instead of Animating Smoothly Between Two Polygons Because They Don’t Have the Same Number of Points

🎨 Fix a clip-path Shape Silently Snapping Instead of Animating Smoothly Between Two Polygons Because They Don’t Have the Same Number of Points Animating or transitioning clip-path: polygon(…) between two different polygon values requires the browser to interpolate each point of the starting shape to the corresponding point of the ending shape, matched up purely […]

Read More
CSS

CSS: Fix an initial-letter Drop Cap Overlapping the Line Below It Because the Property Ignores the Paragraph’s Own Line-Height

- 02.11.26 - ErcanOPAK comment on CSS: Fix an initial-letter Drop Cap Overlapping the Line Below It Because the Property Ignores the Paragraph’s Own Line-Height

🎨 Fix an initial-letter Drop Cap Overlapping the Line Below It Because the Property Ignores the Paragraph’s Own Line-Height The initial-letter property sizes a drop cap by a count of lines it should visually span (initial-letter: 3 2;, for instance), computing that size from the font’s own metrics and the specified line count — not […]

Read More
CSS

CSS: Fix Container Queries Never Triggering Because the Parent Element Was Never Given an Explicit container-type

- 01.11.26 - ErcanOPAK comment on CSS: Fix Container Queries Never Triggering Because the Parent Element Was Never Given an Explicit container-type

🎨 Fix Container Queries Never Triggering Because the Parent Element Was Never Given an Explicit container-type A container query lets a component adapt its own layout based on the size of its nearest ancestor rather than the viewport, which is exactly what makes it useful for a component that gets reused in a wide sidebar […]

Read More
CSS

CSS: Fix aspect-ratio Being Ignored on an Image Because a Legacy height Auto Important Rule Still Wins the Cascade

- 01.11.26 - ErcanOPAK comment on CSS: Fix aspect-ratio Being Ignored on an Image Because a Legacy height Auto Important Rule Still Wins the Cascade

🎨 Fix aspect-ratio Being Ignored on an Image Because a Legacy height Auto Important Rule Still Wins the Cascade The aspect-ratio property only has something to compute from when one of an element’s two dimensions is genuinely auto by the time layout actually resolves it – a specified value of auto is not the same […]

Read More
CSS

CSS: Fix accent-color Not Applying to a Native Checkbox Because a Utility CSS Framework’s Ancestor Rule Wins the Specificity Fight

- 01.11.26 - ErcanOPAK comment on CSS: Fix accent-color Not Applying to a Native Checkbox Because a Utility CSS Framework’s Ancestor Rule Wins the Specificity Fight

🎨 Fix accent-color Not Applying to a Native Checkbox Because a Utility CSS Framework’s Ancestor Rule Wins the Specificity Fight accent-color is an inherited CSS property, which is exactly why it’s convenient: setting it once on a form or a body element themes every native checkbox, radio, range, and progress element underneath without touching each […]

Read More
CSS

CSS: Fix a Native CSS Nesting Rule That Silently Stops Matching Because the Nested Type Selector Needed an Explicit Ampersand and Never Got One

- 31.10.26 - ErcanOPAK comment on CSS: Fix a Native CSS Nesting Rule That Silently Stops Matching Because the Nested Type Selector Needed an Explicit Ampersand and Never Got One

🎨 Fix a Native CSS Nesting Rule That Silently Stops Matching Because the Nested Type Selector Needed an Explicit Ampersand and Never Got One Native CSS nesting lets you write a selector inside another rule’s braces and have it apply relative to the parent, and for a nested selector that starts with a class, an […]

Read More
CSS

CSS: Fix a Custom Checkbox Built With appearance: none Losing Its Checked State Styling in Print Preview Because the Browser’s Print Stylesheet Resets appearance

- 31.10.26 - ErcanOPAK comment on CSS: Fix a Custom Checkbox Built With appearance: none Losing Its Checked State Styling in Print Preview Because the Browser’s Print Stylesheet Resets appearance

🎨 Fix a Custom Checkbox Built With appearance: none Losing Its Checked State Styling in Print Preview Because the Browser’s Print Stylesheet Resets appearance Setting appearance: none on a checkbox strips away the browser’s native checkbox rendering so a custom background, border, and a checked-state indicator built with a pseudo-element can take over completely, and […]

Read More
CSS

CSS: Fix Text Inside a Button Element Not Inheriting the Page’s Font Because Browsers Apply Their Own Default Form-Control Font Stack

- 31.10.26 - ErcanOPAK comment on CSS: Fix Text Inside a Button Element Not Inheriting the Page’s Font Because Browsers Apply Their Own Default Form-Control Font Stack

🎨 Fix Text Inside a Button Element Not Inheriting the Page’s Font Because Browsers Apply Their Own Default Form-Control Font Stack Setting a font-family on the body element and expecting every piece of text on the page to inherit it is a completely reasonable assumption almost everywhere, except for form controls, where browsers have historically […]

Read More
CSS

CSS: Fix Printed Pages Losing Every Background Color Because Browsers Disable Background Graphics in Print by Default

- 31.10.26 - ErcanOPAK comment on CSS: Fix Printed Pages Losing Every Background Color Because Browsers Disable Background Graphics in Print by Default

🎨 Fix Printed Pages Losing Every Background Color Because Browsers Disable Background Graphics in Print by Default Every major browser strips background colors and background images from a page the moment it is sent to a printer or saved as a PDF through the print dialog, on the assumption that most people printing a web […]

Read More
CSS

CSS: Fix a prefers-color-scheme Media Query Being Ignored Because an Inline style Attribute on the Same Element Always Wins

- 30.10.26 - ErcanOPAK comment on CSS: Fix a prefers-color-scheme Media Query Being Ignored Because an Inline style Attribute on the Same Element Always Wins

🎨 Fix a prefers-color-scheme Media Query Being Ignored Because an Inline style Attribute on the Same Element Always Wins An inline style attribute has a specificity that no selector-based rule — including one inside a @media (prefers-color-scheme: dark) block — can override without !important. It’s a common pattern to set a background or color inline […]

Read More
CSS

CSS: Fix a :has() Selector Never Matching Because the Browser Evaluates It Against the Live DOM, Not the One in Dev Tools’ Snapshot

- 30.10.26 - ErcanOPAK comment on CSS: Fix a :has() Selector Never Matching Because the Browser Evaluates It Against the Live DOM, Not the One in Dev Tools’ Snapshot

🎨 Fix a :has() Selector Never Matching Because the Browser Evaluates It Against the Live DOM, Not the One in Dev Tools’ Snapshot :has() is a relational pseudo-class that the browser’s rendering engine evaluates against the actual, current DOM at the moment it recalculates styles — it has no concept of a static page you […]

Read More
CSS

CSS: Fix a Container Query Unit Computing Against the Wrong Ancestor Because Only the Nearest container-type Element Counts

- 30.10.26 - ErcanOPAK comment on CSS: Fix a Container Query Unit Computing Against the Wrong Ancestor Because Only the Nearest container-type Element Counts

🎨 Fix a Container Query Unit Computing Against the Wrong Ancestor Because Only the Nearest container-type Element Counts A container query length unit like cqw always resolves against the nearest ancestor that has container-type set on the relevant axis – it does not know or care which container you intended as ‘the’ container when you […]

Read More
CSS

CSS: Fix a scroll-snap-align Carousel Snapping to the Wrong Slide Every Time You Resize the Browser Window

- 29.10.26 - ErcanOPAK comment on CSS: Fix a scroll-snap-align Carousel Snapping to the Wrong Slide Every Time You Resize the Browser Window

🎨 Fix a scroll-snap-align Carousel Snapping to the Wrong Slide Every Time You Resize the Browser Window Scroll snapping calculates its snap points from each item’s actual box geometry, which the browser recomputes immediately on any resize – but the scroll container’s current scroll offset doesn’t get recalculated at the same time. If slides are […]

Read More
Page 1 of 9
1 2 3 4 5 6 … 9 Next »

Posts pagination

1 2 3 … 9 Next »
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (661)
  • Add Constraint to SQL Table to ensure email contains @ (619)
  • Average of all values in a column that are not zero in SQL (577)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (553)
  • Find numbers with more than two decimal places in SQL (481)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • AÄŸ Hızı İzleyici Windows Uygulaması v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store
  • WordPress: Fix a Navigation Block Losing Submenu Items After Sync
  • Visual Studio: Fix CodeLens Reference Counts Stuck at Stale Numbers
  • C#: Fix a UTF-8 String Literal Behaving Differently in a Switch
  • Photoshop: Fix a Liquify Mesh Snapping Back on a Smart Object
  • The AI Prompt That Turns a Crash Dump Into a Short Repro Script

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • AÄŸ Hızı İzleyici Windows Uygulaması v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com