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: Why a Pinned Overlay Starts Scrolling With the Page the Moment a Parent Element Gets Any transform

- 03.10.26 - ErcanOPAK comment on CSS: Why a Pinned Overlay Starts Scrolling With the Page the Moment a Parent Element Gets Any transform

🔧 The Pinned Overlay That Started Scrolling Away With Everything Else position: fixed is specified to position an element relative to the viewport – until an ancestor somewhere between it and the document root has a transform, a filter, or a few other specific properties applied, any one of which creates a new containing block […]

Read More
CSS

CSS: Fix a Text-Overflow Ellipsis That Never Appears Because the Container Has No Fixed Width

- 03.10.26 - ErcanOPAK comment on CSS: Fix a Text-Overflow Ellipsis That Never Appears Because the Container Has No Fixed Width

🔧 The Ellipsis That Was Configured Correctly and Still Never Showed Up Setting text-overflow: ellipsis alongside overflow: hidden and white-space: nowrap on an element – the textbook three-property combination every reference says is required – reads like it should be enough on its own to truncate long text anywhere it’s applied. It isn’t, if the […]

Read More
CSS

CSS: Fix a Line-Clamp Truncation That Cuts Off Mid-Word Instead of Adding an Ellipsis

- 27.09.26 - ErcanOPAK comment on CSS: Fix a Line-Clamp Truncation That Cuts Off Mid-Word Instead of Adding an Ellipsis

🎨 The Line Clamp That Cut a Word Cleanly in Half -webkit-line-clamp (the common way to truncate text to a fixed number of lines with a trailing ellipsis) depends entirely on display: -webkit-box and the matching box-orient property being set alongside it – it’s not a standalone property that works on its own. Leaving out […]

Read More
CSS

CSS: Fix a Container Query That Never Triggers Because of a Missing Containment Property

- 27.09.26 - ErcanOPAK comment on CSS: Fix a Container Query That Never Triggers Because of a Missing Containment Property

🎨 The Container Query That Was Watching an Element That Wasn’t a Container An @container rule only ever evaluates against the nearest ancestor that has actually been established as a query container via the container-type property – simply nesting an element inside any ancestor and writing an @container rule does nothing at all if that […]

Read More
CSS

CSS: Fix a Custom Property That Silently Falls Back to Its Default Value

- 27.09.26 - ErcanOPAK comment on CSS: Fix a Custom Property That Silently Falls Back to Its Default Value

🎨 The CSS Variable That Kept Reverting to a Value Nobody Set Anymore A CSS custom property (`–my-variable`) that’s supposed to be controlled dynamically (via JavaScript, or overridden in a more specific selector) can silently fall back to its declared default value inside a `var()` function – not because the override failed, but because the […]

Read More
CSS

CSS: Fix a Background Image That Repeats When It Should Only Show Once

- 26.09.26 - ErcanOPAK comment on CSS: Fix a Background Image That Repeats When It Should Only Show Once

🎨 One Logo Image, Tiled Across the Entire Page Like Wallpaper `background-repeat` defaults to `repeat` on every element – so a background image intended to appear once (a logo watermark, a single decorative graphic) tiles endlessly across the full size of its container the moment that container is even slightly larger than the image itself, […]

Read More
CSS

CSS: Fix a Transition That Refuses to Animate the First Time an Element Appears on the Page

- 26.09.26 - ErcanOPAK comment on CSS: Fix a Transition That Refuses to Animate the First Time an Element Appears on the Page

🎨 The Animation Works Every Time Except the First A CSS `transition` set up to animate an element into view (fading in, sliding in) often does nothing the very first time the element appears, then works perfectly on every subsequent change – because the element’s initial and final styles were both applied in the same […]

Read More
CSS

CSS: Fix a Hover Effect That Flickers Repeatedly Instead of Staying Stable

- 26.09.26 - ErcanOPAK comment on CSS: Fix a Hover Effect That Flickers Repeatedly Instead of Staying Stable

🎨 Your Hover Effect Flickers Repeatedly Instead of Just… Staying Hovered A hover effect (a dropdown menu, a tooltip, an expanding card) rapidly flickers on and off while the cursor sits still directly over the element – and this almost always means the HOVER STATE ITSELF is changing the element’s size, position, or layout in […]

Read More
CSS

CSS: Fix an Image That Distorts Instead of Cropping Inside a Fixed-Size Container

- 06.09.26 - ErcanOPAK comment on CSS: Fix an Image That Distorts Instead of Cropping Inside a Fixed-Size Container

🎨 Your Images Squish and Stretch Instead of Cropping to Fit Their Container Images of varying aspect ratios are placed into a fixed-size container – a grid of thumbnails, a card layout – and instead of cropping to fill the space cleanly, every image squishes or stretches to match the container’s exact dimensions, because `width`/`height` […]

Read More
CSS

CSS: Fix a Z-Index That Has No Effect Because of a Missing Position Value

- 06.09.26 - ErcanOPAK comment on CSS: Fix a Z-Index That Has No Effect Because of a Missing Position Value

🎨 Your z-index Is Set Correctly – and Completely Ignored An element is given `z-index: 999` specifically to force it above everything else on the page, and it stays stubbornly behind other elements anyway – because `z-index` only has any effect on a POSITIONED element (`position` set to `relative`, `absolute`, `fixed`, or `sticky`); on an […]

Read More
CSS

CSS: Fix a Grid Layout Where Columns Ignore the Widths You Set

- 06.09.26 - ErcanOPAK comment on CSS: Fix a Grid Layout Where Columns Ignore the Widths You Set

🎨 Your Grid Columns Are Ignoring the Widths You Explicitly Set A CSS Grid is given explicit column widths – `grid-template-columns: 1fr 1fr 1fr` – and one column still ends up wider than the others, stretching the whole layout, because a grid track’s MINIMUM size defaults to the size of its content, and long unbreakable […]

Read More
CSS

CSS: Fix a Tooltip That Gets Clipped by a Parent’s overflow: hidden

- 05.09.26 - ErcanOPAK comment on CSS: Fix a Tooltip That Gets Clipped by a Parent’s overflow: hidden

🎨 The Tooltip Renders – Half of It Gets Cut Off by Its Own Container A tooltip positioned to appear above or beside its trigger element gets visibly clipped right at the container’s edge – the tooltip’s CSS positioning is correct, it’s just that part of it falls outside a boundary the parent container is […]

Read More
CSS

CSS: Fix an Image That Won’t Center No Matter What Margin or Text-Align You Try

- 05.09.26 - ErcanOPAK comment on CSS: Fix an Image That Won’t Center No Matter What Margin or Text-Align You Try

🎨 margin: auto Isn’t Centering Your Image – Here’s What’s Actually Missing An image sits stubbornly to the left of its container no matter how many centering tricks get thrown at it – margin: auto, text-align: center, even display: flex with justify-content: center – one of them should have worked, and something about the image’s […]

Read More
CSS

CSS: Fix a Flexbox Gap That Collapses on Older Browsers

- 05.09.26 - ErcanOPAK comment on CSS: Fix a Flexbox Gap That Collapses on Older Browsers

🎨 The gap Property Looks Perfect – Until an Older Browser Opens It Flexbox layouts spaced out with the modern gap property look exactly right in your own browser during development, and on an older browser version – still in real use by a meaningful slice of visitors – every item collapses together with zero […]

Read More
CSS

CSS: Fix a Sticky Header That Stops Sticking Inside a Scrollable Parent

- 31.08.26 - ErcanOPAK comment on CSS: Fix a Sticky Header That Stops Sticking Inside a Scrollable Parent

🎨 position: sticky Works Everywhere Except Inside This One Container A sticky header works perfectly when tested on its own, and the moment it’s placed inside a scrollable card or panel, it stops sticking entirely – scrolling right past the top of its container as if position: sticky had no effect at all. 🐞 The […]

Read More
CSS

CSS: Fix Elements That Ignore max-width Because of a Missing box-sizing Reset

- 31.08.26 - ErcanOPAK comment on CSS: Fix Elements That Ignore max-width Because of a Missing box-sizing Reset

🎨 max-width: 300px, But It’s Rendering Wider Than That You set max-width: 300px on a box, add some padding and a border for breathing room, and the element renders noticeably WIDER than 300px anyway — not because max-width is broken, but because of what padding and border do to the default box model. 🐞 The […]

Read More
CSS

CSS: Fix Text That Overflows Its Container Instead of Wrapping With One Property

- 31.08.26 | 31.08.26 - ErcanOPAK comment on CSS: Fix Text That Overflows Its Container Instead of Wrapping With One Property

🎨 Long Word Breaking Your Layout? One Property Fixes It A single unbroken long word or URL — not spaces-separated text, which wraps fine by default — can push right through a container’s edge and break your entire layout, and the fix is one CSS property most people never learn exists. 🐞 The Problem <div […]

Read More
CSS

CSS: Fix Flexbox Items That Refuse to Shrink Below Their Content Size

- 30.08.26 | 31.08.26 - ErcanOPAK comment on CSS: Fix Flexbox Items That Refuse to Shrink Below Their Content Size

🎨 min-width: auto Is Secretly Winning A flex item with flex-shrink: 1 that still overflows its container — text spilling out, images pushing past the edge — almost always has one invisible default working against it: flex items refuse to shrink below their content’s natural size unless you explicitly tell them otherwise. 🐞 The Problem […]

Read More
CSS

CSS: Stop z-index Fights Forever by Understanding Stacking Contexts

- 30.08.26 | 31.08.26 - ErcanOPAK comment on CSS: Stop z-index Fights Forever by Understanding Stacking Contexts

🎨 z-index: 9999 Isn’t the Fix Bumping z-index higher and higher until an element “finally” appears on top is treating the symptom — the real cause is almost always a parent element that accidentally created its own stacking context, trapping its children below other content no matter what z-index you set. 🐞 The Problem .dropdown […]

Read More
CSS

CSS: Fix the Horizontal Scrollbar Nightmare With Two Properties Nobody Sets by Default

- 30.08.26 - ErcanOPAK comment on CSS: Fix the Horizontal Scrollbar Nightmare With Two Properties Nobody Sets by Default

🎨 border-box = No More Scrollbars A single wide image, a long word, or one element with a fixed width breaks your entire page layout sideways — and hunting down which element is causing it can eat an entire afternoon. 🐞 The Problem /* This innocent-looking rule can cause horizontal overflow: */ .card { width: […]

Read More
CSS

Adım Adım: CSS Grid Layout ile Modern Web Tasarımı

- 18.08.26 - ErcanOPAK comment on Adım Adım: CSS Grid Layout ile Modern Web Tasarımı

📐 CSS Grid = Modern Layout Float ve table eski moda. Adım adım CSS Grid ile modern web tasarımı yapın. 🎯 Adım 1-5: CSS Grid /* Adım 1: Grid Container */ .grid-container { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-rows: auto 1fr auto; gap: 20px; } /* Adım 2: Grid Items */ .header { grid-column: […]

Read More
CSS

CSS: Container Queries ile Component-Based Responsive Design

- 18.08.26 - ErcanOPAK comment on CSS: Container Queries ile Component-Based Responsive Design

📦 Container Queries = Component Responsive Media queries yeterli değil. CSS Container Queries ile component bazlı responsive design yapın. 🎯 Container Queries Örnekleri /* 1. Container Definition */ .card-container { container-type: inline-size; container-name: card; } /* 2. Container Query */ @container card (min-width: 300px) { .card { display: flex; flex-direction: row; gap: 16px; } .card-image […]

Read More
CSS

CSS: Responsive Design with CSS Grid and Flexbox

- 17.08.26 - ErcanOPAK comment on CSS: Responsive Design with CSS Grid and Flexbox

📱 Responsive Design = Mobile-First Every device needs a great experience. CSS Grid and Flexbox enable responsive, mobile-first layouts for all screen sizes. 📝 Responsive Patterns // Mobile-First Grid .grid-container { display: grid; grid-template-columns: 1fr; gap: 16px; } // Tablet @media (min-width: 768px) { .grid-container { grid-template-columns: repeat(2, 1fr); } } // Desktop @media (min-width: […]

Read More
CSS

CSS: Master CSS Variables for Theme Management

- 17.08.26 - ErcanOPAK comment on CSS: Master CSS Variables for Theme Management

🎨 CSS Variables = Theme Management Hard-coded colors are a maintenance nightmare. CSS Variables enable consistent theming and easy updates. 📝 CSS Variables Setup :root { /* Colors */ –color-primary: #3498db; –color-secondary: #2ecc71; –color-accent: #e74c3c; –color-background: #ffffff; –color-text: #2c3e50; –color-text-secondary: #7f8c8d; /* Typography */ –font-family: ‘Inter’, -apple-system, sans-serif; –font-size-base: 16px; –font-size-large: 1.25rem; –font-size-small: 0.875rem; /* […]

Read More
CSS

CSS: Creating Responsive Navigation Menus

- 16.08.26 - ErcanOPAK comment on CSS: Creating Responsive Navigation Menus

📱 Responsive Navigation = Mobile First Navigation should work everywhere. Responsive navigation adapts to all screen sizes. 📝 Navigation HTML <nav class=”navbar” role=”navigation” aria-label=”Main Navigation”> <div class=”navbar-brand”> <a href=”/”>MySite</a> </div> <button class=”navbar-toggle” aria-label=”Toggle menu” aria-expanded=”false”> <span class=”bar”></span> <span class=”bar”></span> <span class=”bar”></span> </button> <ul class=”navbar-menu” role=”menubar”> <li role=”none”><a href=”/” role=”menuitem”>Home</a></li> <li role=”none”><a href=”/about” role=”menuitem”>About</a></li> <li role=”none” […]

Read More
CSS

CSS: Creating 3D Effects with CSS Transforms

- 16.08.26 - ErcanOPAK comment on CSS: Creating 3D Effects with CSS Transforms

🎲 3D Effects = CSS Transforms 3D effects create immersive experiences. CSS transforms enable 3D animations and interactions. 📝 3D Transforms // 3D Rotate .card { transform: perspective(1000px) rotateY(20deg); transition: transform 0.3s ease; } .card:hover { transform: perspective(1000px) rotateY(0deg); } // 3D Flip .flip-card { perspective: 1000px; } .flip-card-inner { transform-style: preserve-3d; transition: transform 0.6s […]

Read More
CSS

CSS: Creating Animated Backgrounds with CSS

- 16.08.26 - ErcanOPAK comment on CSS: Creating Animated Backgrounds with CSS

✨ Animated Backgrounds = Engaging UI Static backgrounds are boring. CSS animated backgrounds create engaging, dynamic interfaces. 📝 Animated Backgrounds // Gradient Animation @keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } .animated-gradient { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background-size: 200% […]

Read More
CSS

CSS: Responsive Typography with Fluid Font Sizes

- 15.08.26 - ErcanOPAK comment on CSS: Responsive Typography with Fluid Font Sizes

📝 Fluid Typography = Responsive Text Fixed font sizes don’t scale. Fluid typography creates responsive text that adapts to any screen. 📝 Fluid Typography Implementation /* CSS Clamp */ h1 { font-size: clamp(2rem, 5vw, 4rem); } p { font-size: clamp(1rem, 1.5vw, 1.25rem); } /* Fluid Type Scale */ :root { –text-small: clamp(0.8rem, 1vw, 1rem); –text-base: […]

Read More
CSS

CSS: Dark Mode and Light Mode with CSS Variables

- 15.08.26 - ErcanOPAK comment on CSS: Dark Mode and Light Mode with CSS Variables

🌙 Dark Mode = User Choice Users love dark mode. CSS variables make it easy to implement both dark and light themes. 📝 Theme Implementation /* Light Theme */ :root { –bg-color: #ffffff; –text-color: #1a1a2e; –card-bg: #f5f5f5; –border-color: #e0e0e0; –shadow-color: rgba(0,0,0,0.1); –accent-color: #3498db; } /* Dark Theme */ [data-theme=”dark”] { –bg-color: #1a1a2e; –text-color: #e0e0e0; –card-bg: […]

Read More
CSS

CSS: Advanced Animations with Keyframes and Transitions

- 15.08.26 - ErcanOPAK comment on CSS: Advanced Animations with Keyframes and Transitions

✨ CSS Animations = Interactive UI Static interfaces are boring. CSS animations create engaging, interactive user experiences. 📝 Animation Examples // Fade In @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .fade-in { animation: fadeIn 0.5s ease-out forwards; } // Slide In @keyframes slideIn { […]

Read More
Page 3 of 9
« Previous 1 2 3 4 5 6 7 8 9 Next »

Posts pagination

« Previous 1 2 3 4 5 … 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