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: HTML

HTML

Why Forms Fail Silently on Mobile Browsers

- 30.01.26 - ErcanOPAK comment on Why Forms Fail Silently on Mobile Browsers

Form works on desktop… submits nothing on mobile. Common culprit Missing or incorrect input types. Fix <input type=”email” autocomplete=”email” required> Why Mobile browsers optimize behavior based on type.

Read More
HTML

Stop Breaking Mobile Layouts: Viewport Isn’t Optional

- 29.01.26 - ErcanOPAK comment on Stop Breaking Mobile Layouts: Viewport Isn’t Optional

Missing or incorrect viewport causes: Zoomed pages Tiny text Broken responsive layouts Correct <meta name=”viewport” content=”width=device-width, initial-scale=1″> Why Mobile browsers emulate desktop width without it.

Read More
HTML

Native Lazy Loading

- 28.01.26 - ErcanOPAK comment on Native Lazy Loading

<img loading=”lazy” src=”image.jpg”> Why it mattersFaster pages, zero JS.

Read More
HTML

details + summary for Native Toggles

- 27.01.26 - ErcanOPAK comment on details + summary for Native Toggles

<details> <summary>More info</summary> Hidden content </details> Why it mattersAccessible, interactive, no JS.

Read More
HTML

Native Lazy Loading Without JS

- 26.01.26 | 26.01.26 - ErcanOPAK comment on Native Lazy Loading Without JS

<img src=”img.jpg” loading=”lazy”> Why it mattersInstant speed win, zero JS.

Read More
HTML

The loading=”lazy” Attribute That Saves Bandwidth Instantly

- 25.01.26 - ErcanOPAK comment on The loading=”lazy” Attribute That Saves Bandwidth Instantly

<img src=”hero.jpg” loading=”lazy” alt=”Hero image”> Why this mattersImages load only when needed → faster pages, better Core Web Vitals.

Read More
HTML

Stop Using div for Everything — Accessibility Depends on This

- 24.01.26 - ErcanOPAK comment on Stop Using div for Everything — Accessibility Depends on This

Semantic HTML isn’t about style — it’s about meaning. <nav> <main> <article> <section> Why this mattersScreen readers, SEO bots, and search rankings depend on semantics.

Read More
HTML

HTML Buttons Submit Forms Accidentally

- 23.01.26 - ErcanOPAK comment on HTML Buttons Submit Forms Accidentally

Click → page reload. Why it happensDefault button type is submit. Why it mattersUnexpected behavior. Vital fix <button type=”button”>  

Read More
HTML

HTML Inputs Behave Differently Across Browsers

- 22.01.26 - ErcanOPAK comment on HTML Inputs Behave Differently Across Browsers

Same markup, different results. Why it happensBrowser-specific default behaviors. Why it mattersForms break silently. Smart fixAlways specify input types explicitly.

Read More
HTML

HTML Forms Submit Unexpected Data

- 21.01.26 - ErcanOPAK comment on HTML Forms Submit Unexpected Data

Server receives extra fields. Why it happensDisabled fields are excluded; readonly are included. Why it mattersValidation inconsistencies. Smart fixUse readonly when value must be submitted. <input readonly value=”123″ />  

Read More
HTML

HTML5 Videos Don’t Autoplay

- 18.01.26 - ErcanOPAK comment on HTML5 Videos Don’t Autoplay

Works locally, fails in browser. WhyBrowser blocks autoplay with sound. TipMute video for autoplay. <video autoplay muted></video>  

Read More
HTML

HTML Forms Submit Slower Than Expected

- 16.01.26 - ErcanOPAK comment on HTML Forms Submit Slower Than Expected

Simple forms, slow UX. WhyBlocking validation scripts. TipDefer non-critical scripts.

Read More
HTML

HTML Pages Load Slower Due to Metadata

- 15.01.26 - ErcanOPAK comment on HTML Pages Load Slower Due to Metadata

Invisible but costly. WhyExcessive meta and preload tags. TipOnly preload critical assets.

Read More
HTML

HTML Forms Lose Data on Refresh

- 14.01.26 - ErcanOPAK comment on HTML Forms Lose Data on Refresh

User frustration guaranteed. WhyNo persistence mechanism. TipUse session storage for form state.

Read More
HTML

HTML Forms Break Accessibility Without Visible Errors

- 13.01.26 - ErcanOPAK comment on HTML Forms Break Accessibility Without Visible Errors

Looks fine visually. WhyMissing label associations and ARIA hints. Tip Bind labels explicitly to inputs.

Read More
HTML

HTML Input Types Behave Differently Across Browsers

- 12.01.26 - ErcanOPAK comment on HTML Input Types Behave Differently Across Browsers

Same markup, different UX. WhyInput validation rules vary by browser. Tip Always validate on the server too.

Read More
HTML

HTML5 Video Autoplay Fails Randomly

- 11.01.26 - ErcanOPAK comment on HTML5 Video Autoplay Fails Randomly

Works locally, fails online. WhyAutoplay requires muted audio. Fix Always combine autoplay with muted.

Read More
HTML

HTML Forms Submit Twice on Fast Clicks

- 07.01.26 - ErcanOPAK comment on HTML Forms Submit Twice on Fast Clicks

Users accidentally double-submit. WhyNo submit lock during async handling. Fix Disable submit button after first click.

Read More
HTML

HTML5 Videos Don’t Autoplay on Mobile

- 06.01.26 - ErcanOPAK comment on HTML5 Videos Don’t Autoplay on Mobile

Works on desktop. WhyMobile requires muted autoplay. Fix <video autoplay muted playsinline></video>  

Read More
HTML

HTML5 Input Autofill Breaks Layout

- 05.01.26 - ErcanOPAK comment on HTML5 Input Autofill Breaks Layout

Unexpected styling appears. WhyBrowser injects default styles. Fix input:-webkit-autofill { transition: background-color 9999s; }  

Read More
HTML

HTML5 Video Controls Fail on iOS

- 04.01.26 - ErcanOPAK comment on HTML5 Video Controls Fail on iOS

Works on desktop. WhyiOS requires explicit attributes. Fix <video controls playsinline></video>  

Read More
HTML

HTML5 Videos Fail on Mobile Browsers

- 03.01.26 - ErcanOPAK comment on HTML5 Videos Fail on Mobile Browsers

Desktop works, mobile doesn’t. WhyAutoplay restrictions require muted playback. Fix <video autoplay muted playsinline></video>  

Read More
HTML

HTML Forms Submit Twice

- 03.01.26 - ErcanOPAK comment on HTML Forms Submit Twice

Looks like a JavaScript bug. WhyButtons default to type=”submit”. Fix <button type=”button”>Save</button>  

Read More
HTML

HTML Forms Break Accessibility

- 02.01.26 - ErcanOPAK comment on HTML Forms Break Accessibility

Looks fine, fails screen readers. WhyMissing explicit label bindings. Fix Always link label with for.

Read More
HTML

HTML5 Forms Submitting Twice

- 01.01.26 - ErcanOPAK comment on HTML5 Forms Submitting Twice

Looks like a JS bug — often isn’t. Why it happensButton defaults to type=”submit”. FixAlways declare button types explicitly.

Read More
HTML

HTML5 — defer Beats async for Script Order

- 31.12.25 - ErcanOPAK comment on HTML5 — defer Beats async for Script Order

async breaks dependency order. Fix Use defer for predictable loading.

Read More
HTML

HTML5 — Must Be First

- 30.12.25 - ErcanOPAK comment on HTML5 — Must Be First

Late charset causes encoding bugs. ✅ Correct Place it as the first meta tag.

Read More
HTML

HTML5 —

- 29.12.25 - ErcanOPAK comment on HTML5 —

Default behavior surprises many. ✅ Fix Always set: <button type=”button”>  

Read More
HTML

Native Modals with

- 29.12.25 - ErcanOPAK comment on Native Modals with

The Problem: You are importing a massive JavaScript library just to show a simple popup modal. The Fix: HTML5 now has a native <dialog> element with built-in accessibility and backdrop support. <dialog id=”myDialog”> <p>This is a native modal!</p> <button onclick=”document.getElementById(‘myDialog’).close()”>Close</button> </dialog> <button onclick=”document.getElementById(‘myDialog’).showModal()”>Open Modal</button>  

Read More
HTML

HTML5 — Without width/height Causes Layout Shift

- 28.12.25 - ErcanOPAK comment on HTML5 — Without width/height Causes Layout Shift

CLS hurts SEO and UX. ✅ Fix Always specify dimensions.

Read More
Page 2 of 3
« Previous 1 2 3 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

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

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

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