Skip to content

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: Use Filter Effects for Visual Magic

- 12.07.26 - ErcanOPAK comment on CSS: Use Filter Effects for Visual Magic

๐ŸŽจ Filter Effects = Visual Magic Images need effects. CSS filters apply visual effects. Blur, brightness, contrast โ€” no Photoshop needed. ๐Ÿ“ Filter Functions /* Blur */ filter: blur(5px); filter: blur(2px); /* Brightness */ filter: brightness(0.8); filter: brightness(1.2); filter: brightness(200%); /* Contrast */ filter: contrast(1.5); filter: contrast(200%); /* Grayscale */ filter: grayscale(100%); filter: grayscale(0.5); /* […]

Read More
CSS

CSS: Master Gradients for Color Transitions

- 12.07.26 - ErcanOPAK comment on CSS: Master Gradients for Color Transitions

๐ŸŒˆ Gradients = Color Transitions Solid colors are basic. Gradients create smooth transitions. Modern, vibrant, professional. ๐Ÿ“ Gradient Types /* Linear Gradient */ background: linear-gradient(to right, red, blue); background: linear-gradient(45deg, red, blue); background: linear-gradient(to bottom, red, yellow, green); /* Radial Gradient */ background: radial-gradient(circle, red, blue); background: radial-gradient(ellipse, red, blue); background: radial-gradient(circle at 50% 50%, […]

Read More
CSS

CSS: Master Border Radius for Rounded Corners

- 12.07.26 - ErcanOPAK comment on CSS: Master Border Radius for Rounded Corners

๐Ÿ”ต Border Radius = Rounded Corners Sharp corners are harsh. Border radius creates smooth corners. Modern, friendly, professional. ๐Ÿ“ Border Radius Basics /* Single value (all corners) */ border-radius: 10px; border-radius: 50%; /* Circle/ellipse */ /* Two values (top-left/bottom-right top-right/bottom-left) */ border-radius: 10px 20px; /* Three values */ border-radius: 10px 20px 30px; /* Four values […]

Read More
CSS

CSS: Master Position Property for Layout Control

- 11.07.26 - ErcanOPAK comment on CSS: Master Position Property for Layout Control

๐Ÿ“ Position = Layout Control Elements need precise positioning. Position property controls layout. Static, relative, absolute, fixed, sticky. ๐Ÿ“ Position Types /* Static (default) */ position: static; – Normal flow – No positioning /* Relative */ position: relative; – Relative to normal position – Offset with top, right, bottom, left – Other elements not affected […]

Read More
CSS

CSS: Master Display Property for Layouts

- 11.07.26 - ErcanOPAK comment on CSS: Master Display Property for Layouts

๐Ÿ“ Display = Layout Control Display controls layout. Block, inline, flex, grid โ€” choose right display for perfect layout. ๐Ÿ“ Display Types /* Block */ display: block; – Full width – Line break before/after – Margin, padding, width, height – Examples: div, p, h1, section /* Inline */ display: inline; – Only as wide as […]

Read More
CSS

CSS: Master Box Model for Layouts

- 11.07.26 - ErcanOPAK comment on CSS: Master Box Model for Layouts

๐Ÿ“ฆ Box Model = Layout Foundation CSS layout starts with box model. Understanding box model creates perfect layouts. Margin, border, padding, content. ๐Ÿ“ Box Model Properties /* Content area */ width: 200px; height: 100px; /* Padding (inside) */ padding: 20px; padding-top: 10px; padding-right: 15px; padding-bottom: 10px; padding-left: 15px; /* Border */ border: 1px solid #333; […]

Read More
CSS

CSS: Master Z-Index for Stack Order

- 10.07.26 - ErcanOPAK comment on CSS: Master Z-Index for Stack Order

๐Ÿ“š Z-Index = Stack Order Elements overlap. Z-index controls stacking order. Modals, tooltips, dropdowns โ€” proper layering. ๐Ÿ“ Z-Index Basics /* Basic usage */ .modal { z-index: 1000; position: fixed; } .tooltip { z-index: 100; position: absolute; } .dropdown { z-index: 50; position: relative; } /* Stacking context */ .parent { position: relative; z-index: 1; […]

Read More
CSS

CSS: Master CSS Units (px, em, rem, vh, vw)

- 10.07.26 - ErcanOPAK comment on CSS: Master CSS Units (px, em, rem, vh, vw)

๐Ÿ“ CSS Units = Perfect Sizing Wrong units break designs. CSS units matter. px, em, rem, vh, vw โ€” choose wisely. ๐Ÿ“ Unit Types /* Absolute Units */ px โ†’ Pixels (fixed) pt โ†’ Points (print) pc โ†’ Picas (print) /* Relative Units (Font) */ em โ†’ Relative to parent font-size rem โ†’ Relative to […]

Read More
CSS

CSS: Master Pseudo Elements (::before & ::after)

- 10.07.26 - ErcanOPAK comment on CSS: Master Pseudo Elements (::before & ::after)

๐ŸŽจ Pseudo Elements = Extra Content Need extra elements without extra HTML? ::before and ::after add content via CSS. ๐Ÿ“ Pseudo Element Basics /* Basic usage */ .element::before { content: “โ˜…”; color: gold; margin-right: 5px; } .element::after { content: ” โ†’”; color: blue; } /* Required: content property */ .element::before { content: “”; /* Empty […]

Read More
CSS

CSS: Use Custom Properties for Maintainable Styles

- 09.07.26 - ErcanOPAK comment on CSS: Use Custom Properties for Maintainable Styles

๐ŸŽจ CSS Variables = Maintainable Styles Hardcoded colors are bad. CSS variables centralize values. Change once, update everywhere. ๐Ÿ“ CSS Variables Basics /* Define variables */ :root { –primary-color: #3498db; –secondary-color: #2ecc71; –text-color: #333; –spacing: 16px; –border-radius: 4px; –font-size: 16px; } /* Use variables */ .button { background: var(–primary-color); color: white; padding: var(–spacing); border-radius: var(–border-radius); […]

Read More
CSS

CSS: Use Container Queries for Component-Level Responsive

- 09.07.26 - ErcanOPAK comment on CSS: Use Container Queries for Component-Level Responsive

๐Ÿ“ฆ Container Queries = Component Responsive Media queries are page-based. Container queries are component-based. Responsive design at component level. ๐Ÿ“ Container Query Basics /* Container definition */ .card-container { container-type: inline-size; container-name: card; } /* Container query */ @container card (min-width: 400px) { .card { display: flex; flex-direction: row; } .card-image { width: 200px; } […]

Read More
CSS

CSS: Master Transforms for 2D and 3D Effects

- 09.07.26 - ErcanOPAK comment on CSS: Master Transforms for 2D and 3D Effects

๐ŸŽฏ CSS Transforms = 2D & 3D Effects Static elements are basic. CSS transforms enable 2D and 3D effects. Rotate, scale, skew, translate โ€” visual magic. ๐Ÿ“ 2D Transforms /* Translate (move) */ transform: translate(50px, 100px); transform: translateX(50px); transform: translateY(50px); /* Rotate */ transform: rotate(45deg); transform: rotate(0.5turn); transform: rotate(3.14rad); /* Scale (zoom) */ transform: scale(1.5); […]

Read More
CSS

CSS: Master Media Queries for Responsive Design

- 07.07.26 - ErcanOPAK comment on CSS: Master Media Queries for Responsive Design

๐Ÿ“ฑ Media Queries = Responsive Design One size fits none. Media queries make responsive designs. Mobile, tablet, desktop โ€” adapt to every screen. ๐Ÿ“ Media Query Syntax /* Basic syntax */ @media (condition) { /* CSS rules */ } /* Width-based */ @media (max-width: 768px) { /* Mobile styles */ } @media (min-width: 769px) and […]

Read More
CSS

CSS: Master Animations with Keyframes and Transitions

- 07.07.26 - ErcanOPAK comment on CSS: Master Animations with Keyframes and Transitions

๐ŸŽฌ CSS Animations = Motion Magic Static pages are boring. CSS animations bring life. Transitions, keyframes, motion โ€” engaging user experiences. ๐Ÿ“ Transitions vs Animations /* Transitions (state changes) */ .button { background: blue; transition: background 0.3s ease, transform 0.2s ease; } .button:hover { background: darkblue; transform: scale(1.05); } /* Keyframe Animations (complex sequences) */ […]

Read More
CSS

CSS: Use CSS Variables for Maintainable Styles

- 07.07.26 - ErcanOPAK comment on CSS: Use CSS Variables for Maintainable Styles

๐ŸŽจ CSS Variables = Maintainable Styles Hardcoded colors are bad. CSS variables centralize values. Change once, update everywhere. Theming made easy. ๐Ÿ“ Variable Basics /* Define variables */ :root { –primary-color: #3498db; –secondary-color: #2ecc71; –text-color: #333; –spacing-unit: 16px; –border-radius: 4px; } /* Use variables */ .button { background-color: var(–primary-color); color: white; padding: var(–spacing-unit); border-radius: var(–border-radius); […]

Read More
CSS

CSS: Master Grid for Two-Dimensional Layouts

- 05.07.26 - ErcanOPAK comment on CSS: Master Grid for Two-Dimensional Layouts

๐Ÿ“ CSS Grid = Two-Dimensional Layouts Flexbox is one-dimensional. CSS Grid handles rows AND columns. Complex layouts made simple. โŒ Complex Flexbox Layout .container { display: flex; flex-wrap: wrap; } .item { flex: 1 0 30%; } โœ… Clean Grid Layout .container { display: grid; grid-template-columns: repeat(3, 1fr); } ๐Ÿ“ Grid Properties /* Container Properties […]

Read More
CSS

CSS: Master Flexbox for Modern Layouts

- 05.07.26 - ErcanOPAK comment on CSS: Master Flexbox for Modern Layouts

๐Ÿ“ Flexbox = One-Dimensional Layouts Floats are dead. Flexbox is modern. Align, distribute, order โ€” all with CSS. Essential for responsive design. โŒ Float Layout .container { overflow: hidden; } .item { float: left; width: 33.33%; padding: 10px; } โœ… Flexbox Layout .container { display: flex; flex-wrap: wrap; } .item { flex: 1 0 33.33%; […]

Read More
CSS

CSS: Use Box Shadow for Depth and Dimension

- 05.07.26 - ErcanOPAK comment on CSS: Use Box Shadow for Depth and Dimension

๐Ÿ›ก๏ธ Add Depth with Box Shadow Flat design is basic. Box shadow adds depth. Realistic depth, elevation, focus. Essential for modern UI. ๐Ÿ“ Box Shadow Syntax /* offset-x offset-y blur-radius spread-radius color */ box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Multiple shadows */ box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06); /* Inset shadow (inner) […]

Read More
CSS

CSS: Use Transitions for Smooth Animations

- 04.07.26 - ErcanOPAK comment on CSS: Use Transitions for Smooth Animations

๐ŸŽฌ Smooth State Changes Instant state changes are jarring. CSS transitions animate changes. Smooth hover, focus, state transitions. ๐Ÿ“ Transition Syntax /* property duration timing-function delay */ transition: background 0.3s ease; /* Multiple properties */ transition: background 0.3s, transform 0.3s, opacity 0.5s; /* All properties (not recommended) */ transition: all 0.3s ease; /* Specific example […]

Read More
CSS

CSS: Use Pseudo Elements (::before, ::after) for Extra Content

- 04.07.26 - ErcanOPAK comment on CSS: Use Pseudo Elements (::before, ::after) for Extra Content

โœจ ::before and ::after = Extra Elements Without HTML Need icons, decorations, or counters? ::before and ::after create extra content via CSS. Clean HTML, powerful styling. โŒ Without ::before <div class=”quote”> <span>โ</span> Text <span>โž</span> </div> โœ… With ::before <div class=”quote”> Text </div> .quote::before { content: “โ”; } .quote::after { content: “โž”; } ๐ŸŽฏ Practical Examples […]

Read More
CSS

CSS: Understand Margin vs Padding for Spacing

- 04.07.26 - ErcanOPAK comment on CSS: Understand Margin vs Padding for Spacing

๐Ÿ“ Margin Outside, Padding Inside Spacing confuses beginners. Margin is outside the element. Padding is inside. Use margin for spacing elements, padding for spacing content. โ†”๏ธ Margin .box { margin: 20px; /* Space outside */ margin-top: 10px; margin-bottom: 10px; margin-left: 20px; margin-right: 20px; margin: 10px 20px; /* top/bottom, left/right */ margin: 10px 20px 30px 40px; […]

Read More
CSS

CSS: Understand Display Property โ€” Block, Inline, Flex, Grid

- 24.06.26 - ErcanOPAK comment on CSS: Understand Display Property โ€” Block, Inline, Flex, Grid

๐Ÿ“ Display = Layout Behavior display: block vs inline vs flex vs grid. Understanding display is key to CSS layouts. Choose the right one. ๐Ÿ“ Display Values /* Block: Takes full width, starts new line */ .block { display: block; width: 100%; } /* Inline: Takes only needed width, no new line */ .inline { […]

Read More
CSS

CSS: Use Z-Index to Control Element Layering

- 24.06.26 - ErcanOPAK comment on CSS: Use Z-Index to Control Element Layering

๐Ÿ“ Elements Stack in 3D HTML elements stack vertically. Z-index controls overlap. Put modals on top, backgrounds behind. ๐Ÿ“ Z-Index Basics .modal { position: fixed; z-index: 1000; /* High number = on top */ } .dropdown { position: absolute; z-index: 100; /* Above content, below modal */ } .tooltip { position: absolute; z-index: 200; /* […]

Read More
CSS

CSS: Use Gradients for Beautiful Backgrounds

- 24.06.26 - ErcanOPAK comment on CSS: Use Gradients for Beautiful Backgrounds

๐ŸŒˆ Solid Colors Are Boring Gradients add depth and visual interest. CSS gradients are easy, fast, no images needed. ๐Ÿ“ Gradient Types /* Linear Gradient */ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(to right, #f093fb, #f5576c); background: linear-gradient(180deg, #4facfe, #00f2fe); /* Radial Gradient */ background: radial-gradient(circle, #ff6b6b, #ee5a6f); background: radial-gradient(ellipse, #56ab2f, #a8e063); /* Conic […]

Read More
CSS

CSS: Use Pseudo Classes for Interactive UI

- 21.06.26 - ErcanOPAK comment on CSS: Use Pseudo Classes for Interactive UI

๐Ÿ–ฑ๏ธ :hover, :active, :focus = Interactive Feedback Static UI is boring. Pseudo classes add interactivity. Hover, click, focus โ€” responsive UI. ๐Ÿ“ Common Pseudo Classes /* Hover (mouse over) */ .button:hover { background: #2980b9; transform: scale(1.05); } /* Active (clicked) */ .button:active { transform: scale(0.95); } /* Focus (tabbed or clicked input) */ input:focus { […]

Read More
CSS

CSS: Understand Float for Legacy Layouts

- 21.06.26 - ErcanOPAK comment on CSS: Understand Float for Legacy Layouts

๐ŸŒŠ Float was Used for Layouts Before Flexbox Floats are legacy. Float wraps text around images, creates multi-column layouts. Learn for legacy code maintenance. ๐Ÿ“ Float Values /* Float left/right */ img { float: left; margin-right: 10px; } /* Clear floats */ .clearfix::after { content: ”; display: table; clear: both; } /* Common layout (legacy) […]

Read More
CSS

CSS: Use Border Radius for Rounded Corners

- 21.06.26 - ErcanOPAK comment on CSS: Use Border Radius for Rounded Corners

๐Ÿ”„ Sharp Corners Look Amateur Rounded corners = modern design. border-radius rounds corners. Cards, buttons, images โ€” softer, friendlier. ๐Ÿ“ Border Radius Syntax /* All corners */ border-radius: 8px; /* Individual corners */ border-radius: 4px 8px 12px 16px; /* top-left, top-right, bottom-right, bottom-left */ /* Different horizontal and vertical */ border-radius: 20px 10px; /* 20px […]

Read More
CSS

CSS: Use Transform for Animations and Layout

- 20.06.26 - ErcanOPAK comment on CSS: Use Transform for Animations and Layout

๐Ÿ”„ Scale, Rotate, Translate โ€” All in CSS JavaScript animations are slow. CSS transform is hardware-accelerated. Smooth animations, better performance. ๐Ÿ“ Transform Functions /* Scale */ transform: scale(1.5); /* 1.5x size */ transform: scaleX(2); /* 2x width */ transform: scaleY(0.5); /* 0.5x height */ /* Rotate */ transform: rotate(45deg); /* 45 degrees */ transform: rotateX(180deg); […]

Read More
CSS

CSS: Use Media Queries for Responsive Design

- 20.06.26 - ErcanOPAK comment on CSS: Use Media Queries for Responsive Design

๐Ÿ“ฑ Desktop, Tablet, Mobile โ€” One CSS Without media queries, same design everywhere. Media queries adapt to screen size. Different layouts for mobile, tablet, desktop. ๐Ÿ“ Basic Media Queries /* Mobile first (default) */ .container { display: block; } /* Tablet */ @media (min-width: 768px) { .container { display: grid; grid-template-columns: 1fr 1fr; } } […]

Read More
CSS

CSS: Use Hover Effects to Improve User Interaction

- 20.06.26 - ErcanOPAK comment on CSS: Use Hover Effects to Improve User Interaction

๐Ÿ–ฑ๏ธ Make Your UI Feel Alive Static UI is boring. Hover effects give feedback. Buttons change color, cards lift, links underline. Better UX, professional feel. ๐Ÿ“ Common Hover Effects /* Button hover */ .button { background: #3498db; transition: background 0.3s ease; } .button:hover { background: #2980b9; } /* Card lift */ .card { transition: transform […]

Read More
Page 1 of 5
1 2 3 4 5 Next ยป

Posts pagination

1 2 3 … 5 Next »
July 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Jun    

Most Viewed Posts

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

Recent Posts

  • C#: Use Using Statements for Resource Management
  • C#: Use Lambda Expressions for Concise Code
  • SQL: Use GROUP BY for Data Aggregation
  • .NET Core: Master Routing for Clean URLs
  • Git: Use Reset to Undo Local Changes
  • Ajax: Use Axios for HTTP Requests
  • JavaScript: Understand Hoisting
  • HTML: Use Web Storage for Client-Side Data
  • CSS: Use Filter Effects for Visual Magic
  • Windows 11: Unlock God Mode for All Settings

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (960)
  • How to add default value for Entity Framework migrations for DateTime and Bool (899)
  • How to make theater mode the default for Youtube (860)
  • Get the First and Last Word from a String or Sentence in SQL (840)
  • How to select distinct rows in a datatable in C# (815)

Recent Posts

  • C#: Use Using Statements for Resource Management
  • C#: Use Lambda Expressions for Concise Code
  • SQL: Use GROUP BY for Data Aggregation
  • .NET Core: Master Routing for Clean URLs
  • Git: Use Reset to Undo Local Changes

Social

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