<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khaled Sabry</title>
    <description>The latest articles on DEV Community by Khaled Sabry (@khaled_sabry_b3ce59424b84).</description>
    <link>https://dev.to/khaled_sabry_b3ce59424b84</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4176531%2F85d5595e-3543-4ca3-abff-200f87b128e0.jpg</url>
      <title>DEV Community: Khaled Sabry</title>
      <link>https://dev.to/khaled_sabry_b3ce59424b84</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khaled_sabry_b3ce59424b84"/>
    <language>en</language>
    <item>
      <title>CSS Works in Chrome but Not Safari or Firefox? A Real Example and Fix</title>
      <dc:creator>Khaled Sabry</dc:creator>
      <pubDate>Mon, 12 Oct 2026 12:01:44 +0000</pubDate>
      <link>https://dev.to/khaled_sabry_b3ce59424b84/css-works-in-chrome-but-not-safari-or-firefox-a-real-example-and-fix-2ho2</link>
      <guid>https://dev.to/khaled_sabry_b3ce59424b84/css-works-in-chrome-but-not-safari-or-firefox-a-real-example-and-fix-2ho2</guid>
      <description>&lt;p&gt;We've all been there.&lt;/p&gt;

&lt;p&gt;You write some CSS, open your page in Chrome, and everything works exactly as expected.&lt;/p&gt;

&lt;p&gt;Then you open Safari or Firefox.&lt;/p&gt;

&lt;p&gt;Suddenly, something that should be simple behaves completely differently.&lt;/p&gt;

&lt;p&gt;I recently came across an interesting &lt;a href="https://www.reddit.com/r/css/comments/1vm6exp/possible_css_bug/" rel="noopener noreferrer"&gt;Reddit discussion in r/css&lt;/a&gt; where a developer encountered exactly this problem.&lt;/p&gt;

&lt;p&gt;The interesting part? It wasn't a complicated layout, JavaScript framework, or browser animation.&lt;/p&gt;

&lt;p&gt;It was a small CSS example involving &lt;code&gt;@property&lt;/code&gt; and container style queries.&lt;/p&gt;

&lt;p&gt;I decided to reproduce the problem, compare its rendering across browsers using Preveo, and then test a possible fix.&lt;/p&gt;

&lt;p&gt;Here's what happened.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Original Problem: Same CSS, Different Results
&lt;/h2&gt;

&lt;p&gt;The original Reddit post, titled &lt;a href="https://www.reddit.com/r/css/comments/1vm6exp/possible_css_bug/" rel="noopener noreferrer"&gt;"Possible CSS Bug"&lt;/a&gt;, was published on August 12, 2026.&lt;/p&gt;

&lt;p&gt;The developer created a minimal example using a registered CSS custom property.&lt;/p&gt;

&lt;p&gt;The CSS looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@property&lt;/span&gt; &lt;span class="n"&gt;--im-a-color&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;syntax&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"&amp;lt;color&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;inherits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;initial-value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.red&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.blue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="py"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the HTML contained three headings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;I should be black&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"red"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;I should also be black&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"blue"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;I should be green&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The expected result was straightforward:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Element&lt;/th&gt;
&lt;th&gt;Expected color&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First heading (default)&lt;/td&gt;
&lt;td&gt;Black&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Second heading (&lt;code&gt;.red&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Black&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Third heading (&lt;code&gt;.blue&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Green&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The reason is the registered custom property's initial value.&lt;/p&gt;

&lt;p&gt;Since &lt;code&gt;--im-a-color&lt;/code&gt; starts at &lt;code&gt;red&lt;/code&gt;, a boolean style query should evaluate to true only when its computed value differs from that initial value.&lt;/p&gt;

&lt;p&gt;Chrome rendered the example as expected, but the original developer reported different behavior in Safari and Firefox.&lt;/p&gt;

&lt;p&gt;This raised an interesting question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Was the CSS wrong, or were browsers interpreting the same CSS differently?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jsfiddle.net/vgn7xy8o/1/" rel="noopener noreferrer"&gt;Open the original JSFiddle&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Why This CSS Is Interesting
&lt;/h2&gt;

&lt;p&gt;The key line is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unlike a traditional media query, a container style query can apply CSS based on a custom property's computed value on an ancestor.&lt;/p&gt;

&lt;p&gt;When using the boolean form with a registered custom property, the condition is supposed to match when that value differs from its registered initial value.&lt;/p&gt;

&lt;p&gt;In our case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initial value: &lt;code&gt;red&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.red&lt;/code&gt; value: &lt;code&gt;red&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.blue&lt;/code&gt; value: &lt;code&gt;blue&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, only the blue example should receive the green heading style.&lt;/p&gt;

&lt;p&gt;This isn't simply about whether a browser supports container queries. It's about whether its implementation produces the expected result for this particular condition.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Containment/Container_size_and_style_queries" rel="noopener noreferrer"&gt;MDN's documentation on container style queries&lt;/a&gt;, registered custom properties have specific matching behavior based on their initial values.&lt;/p&gt;

&lt;p&gt;That makes the original Reddit example particularly useful: it's small enough to isolate one browser behavior without introducing unrelated layout complexity.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. I Ran the Example Through Cross-Browser Testing
&lt;/h2&gt;

&lt;p&gt;Instead of trying to diagnose the problem by switching browsers manually, I used &lt;a href="https://preveo.io" rel="noopener noreferrer"&gt;Preveo&lt;/a&gt;, a tool I've been building to evaluate websites and identify UI problems.&lt;/p&gt;

&lt;p&gt;One of its capabilities is comparing how the same webpage renders in different browser engines:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chromium&lt;/li&gt;
&lt;li&gt;Safari (WebKit)&lt;/li&gt;
&lt;li&gt;Firefox (Gecko)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The idea is simple: load the same page in multiple browsers, capture the rendered results, and compare them visually.&lt;/p&gt;

&lt;p&gt;For this test, I used the original JSFiddle and ran a cross-browser evaluation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before Fix — Preveo Report&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvwjasdhqtggobozp84bc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvwjasdhqtggobozp84bc.png" alt="Comparison on Preveo.io" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://preveo.io/results/559d20ec-b9f2-43ab-adb3-e0fa82d24de1" rel="noopener noreferrer"&gt;View the original cross-browser evaluation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The important thing wasn't just identifying which browser looked different. It was having a reproducible example and a visual reference that could be checked again after making a code change.&lt;/p&gt;

&lt;p&gt;This is especially useful with CSS because two browsers can accept the same declarations while producing different visual results.&lt;/p&gt;

&lt;p&gt;And when that happens in a real application, the consequences can be much more noticeable than a heading having the wrong color.&lt;/p&gt;

&lt;p&gt;Imagine the same kind of difference affecting a navigation bar, pricing card, product button, or an entire theme.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. The Fix: Be Explicit About the Value
&lt;/h2&gt;

&lt;p&gt;For this particular example, I changed the container query from a boolean condition to an explicit value comparison.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a small change, but an important one.&lt;/p&gt;

&lt;p&gt;The original condition asks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is the computed value different from the property's initial value?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The updated condition asks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is the computed value blue?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is a more precise statement of what this particular example needs.&lt;/p&gt;

&lt;p&gt;I also added an explicit default heading color:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures the intended fallback appearance is clear rather than depending on inherited or browser-default text colors.&lt;/p&gt;

&lt;p&gt;The updated example also includes basic HTML document metadata and a small JavaScript diagnostic that logs the computed custom property and heading color.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jsfiddle.net/r9f0ea8o/" rel="noopener noreferrer"&gt;Open the updated JSFiddle&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  An important technical distinction
&lt;/h3&gt;

&lt;p&gt;The explicit query is a practical workaround for this use case, not a universal replacement for boolean style queries.&lt;/p&gt;

&lt;p&gt;For example, if the custom property were changed to &lt;code&gt;green&lt;/code&gt;, the original boolean query should still match because green differs from red.&lt;/p&gt;

&lt;p&gt;The explicit &lt;code&gt;blue&lt;/code&gt; query would not match.&lt;/p&gt;

&lt;p&gt;So this fix makes sense when the intended design is specifically tied to the blue value. It does not establish that the original CSS was invalid, nor does it resolve the underlying browser implementation discrepancy.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Running the Test Again
&lt;/h2&gt;

&lt;p&gt;After modifying the CSS, I evaluated the updated example through the same cross-browser workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After Fix — Preveo Report&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg2xu30a829mp8ztnb7sy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg2xu30a829mp8ztnb7sy.png" alt="Comparison on preveo.io" width="799" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://preveo.io/results/ce7d04b8-45ee-4666-b1ea-ca95484fd0f4" rel="noopener noreferrer"&gt;View the updated cross-browser evaluation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here are the two versions if you want to compare them yourself:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Original&lt;/th&gt;
&lt;th&gt;Updated&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CSS example&lt;/td&gt;
&lt;td&gt;&lt;a href="https://jsfiddle.net/vgn7xy8o/1/" rel="noopener noreferrer"&gt;Before JSFiddle&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://jsfiddle.net/r9f0ea8o/" rel="noopener noreferrer"&gt;After JSFiddle&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cross-browser evaluation&lt;/td&gt;
&lt;td&gt;&lt;a href="https://preveo.io/results/559d20ec-b9f2-43ab-adb3-e0fa82d24de1" rel="noopener noreferrer"&gt;Before report&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://preveo.io/results/ce7d04b8-45ee-4666-b1ea-ca95484fd0f4" rel="noopener noreferrer"&gt;After report&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The useful part of this workflow is being able to evaluate both versions rather than relying on one successful Chrome test.&lt;/p&gt;

&lt;p&gt;A proper regression check should verify that the updated result matches the intended appearance in every browser tested, not just that it looks better in one.&lt;/p&gt;

&lt;p&gt;For a small example like this, that means confirming the heading colors.&lt;/p&gt;

&lt;p&gt;For a production website, it could mean comparing entire pages, typography, component styles, and layout behavior.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. What I Learned from This Example
&lt;/h2&gt;

&lt;p&gt;There are three things I think developers should take away from this.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Browser support doesn't always mean identical behavior
&lt;/h3&gt;

&lt;p&gt;Seeing a feature listed as supported doesn't guarantee that every browser version handles every edge case identically.&lt;/p&gt;

&lt;p&gt;That doesn't automatically make one browser right and another wrong. The specification, implementation details, and exact browser versions all matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A small reproducible example is incredibly valuable
&lt;/h3&gt;

&lt;p&gt;The original developer reduced the problem to three headings and a few CSS declarations.&lt;/p&gt;

&lt;p&gt;That made it much easier to understand what was being tested.&lt;/p&gt;

&lt;p&gt;If you encounter an unexpected rendering difference, isolating the smallest possible example is often more productive than debugging an entire application.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Test the fix across browsers, not just where the problem appeared
&lt;/h3&gt;

&lt;p&gt;It's possible to fix something in Safari and accidentally change the appearance in Chrome.&lt;/p&gt;

&lt;p&gt;That's why I prefer comparing the original and updated versions across multiple browser engines.&lt;/p&gt;

&lt;p&gt;The goal isn't simply to remove one visual difference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal is to make sure the intended experience works consistently for everyone.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Why I Think Cross-Browser Testing Still Matters
&lt;/h2&gt;

&lt;p&gt;Modern frontend development has become dramatically faster.&lt;/p&gt;

&lt;p&gt;We have AI coding assistants, component libraries, CSS frameworks, and tools that can generate entire interfaces from a prompt.&lt;/p&gt;

&lt;p&gt;But there's a problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generating the interface is not the same as validating the interface.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Your application might work perfectly in the browser you use for development while looking different for someone opening it in Safari or Firefox.&lt;/p&gt;

&lt;p&gt;And often, you won't notice until a customer reports it.&lt;/p&gt;

&lt;p&gt;This is one of the problems I'm trying to address with &lt;a href="https://preveo.io" rel="noopener noreferrer"&gt;Preveo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Instead of manually opening every page in multiple browsers and trying to spot differences, I wanted a way to evaluate browser rendering side by side, identify meaningful inconsistencies, and produce actionable suggestions for fixing them.&lt;/p&gt;

&lt;p&gt;The example from Reddit is small, but it illustrates the larger issue perfectly.&lt;/p&gt;

&lt;p&gt;Even a few lines of valid-looking CSS can deserve cross-browser testing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;What started as a Reddit post about a possible CSS bug became an interesting example of why cross-browser validation matters.&lt;/p&gt;

&lt;p&gt;The practical fix for this case was small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Before */&lt;/span&gt;
&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c"&gt;/* ... */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* After */&lt;/span&gt;
&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--im-a-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c"&gt;/* ... */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the bigger lesson is that &lt;strong&gt;CSS working in one browser isn't proof that it works everywhere&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you're building websites—whether manually, with React, using Lovable, or with an AI coding assistant—it's worth checking how the actual result looks across browsers before shipping.&lt;/p&gt;

&lt;p&gt;You can explore the example yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.reddit.com/r/css/comments/1vm6exp/possible_css_bug/" rel="noopener noreferrer"&gt;Original Reddit discussion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jsfiddle.net/vgn7xy8o/1/" rel="noopener noreferrer"&gt;Original CSS example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jsfiddle.net/r9f0ea8o/" rel="noopener noreferrer"&gt;Updated CSS example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://preveo.io/results/559d20ec-b9f2-43ab-adb3-e0fa82d24de1" rel="noopener noreferrer"&gt;Before: Cross-browser evaluation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://preveo.io/results/ce7d04b8-45ee-4666-b1ea-ca95484fd0f4" rel="noopener noreferrer"&gt;After: Cross-browser evaluation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And if you want to evaluate your own website across Chromium, Safari, and Firefox, you can try &lt;a href="https://preveo.io" rel="noopener noreferrer"&gt;Preveo.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you ever had CSS work perfectly in Chrome but behave differently in Safari or Firefox? I'd be interested to hear which browser differences have caused you the most trouble.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Other Articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@khaledsab1997/i-improved-my-websites-seo-score-from-77-to-96-using-one-ai-prompt-a42ce9afcbf6" rel="noopener noreferrer"&gt;I Improved My Website’s SEO Score from 77 to 96 Using One AI Prompt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>I Improved My Website’s SEO Score from 77 to 96 Using One AI Prompt</title>
      <dc:creator>Khaled Sabry</dc:creator>
      <pubDate>Sun, 11 Oct 2026 07:31:35 +0000</pubDate>
      <link>https://dev.to/khaled_sabry_b3ce59424b84/i-improved-my-websites-seo-score-from-77-to-96-using-one-ai-prompt-4cdo</link>
      <guid>https://dev.to/khaled_sabry_b3ce59424b84/i-improved-my-websites-seo-score-from-77-to-96-using-one-ai-prompt-4cdo</guid>
      <description>&lt;h3&gt;
  
  
  How I used an AI-powered SEO evaluation, generated a fix prompt, and let Codex handle the improvements.
&lt;/h3&gt;

&lt;p&gt;I've been building my website for a while, and like many developers using AI tools, I assumed that if the page looked good and worked properly, the SEO was probably fine too.&lt;/p&gt;

&lt;p&gt;Turns out, I was missing quite a few things.&lt;/p&gt;

&lt;p&gt;I decided to run an SEO evaluation on my website using &lt;a href="https://preveo.io/" rel="noopener noreferrer"&gt;Preveo.io&lt;/a&gt; to see what could be improved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My initial score was 77/100.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not terrible, but definitely room for improvement.&lt;/p&gt;

&lt;p&gt;What surprised me wasn't the score itself. It was how many relatively small issues I had overlooked, and how straightforward some of them were to fix.&lt;/p&gt;

&lt;p&gt;Instead of spending hours manually going through the findings, I tried something different.&lt;/p&gt;

&lt;p&gt;I generated a single AI fix prompt, gave it to Codex, applied the changes, and evaluated the page again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result? 77 → 96. A 19-point improvement.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's what I did and what I learned.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Evaluate the Website Before Changing Anything
&lt;/h2&gt;

&lt;p&gt;One mistake I've made when improving websites is jumping straight into fixes without fully understanding what's wrong.&lt;/p&gt;

&lt;p&gt;This time, I wanted to start with an evaluation.&lt;/p&gt;

&lt;p&gt;I used an SEO evaluation macro called &lt;a href="https://preveo.io/macros/Improve-Page-SEO-XStnmf" rel="noopener noreferrer"&gt;Improve Page SEO&lt;/a&gt; in Preveo.&lt;/p&gt;

&lt;p&gt;The macro analyzes the actual webpage, looking at elements such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Page title and meta description&lt;/li&gt;
&lt;li&gt;H1 and heading hierarchy&lt;/li&gt;
&lt;li&gt;Content structure and keyword clarity&lt;/li&gt;
&lt;li&gt;Image alt attributes&lt;/li&gt;
&lt;li&gt;Internal and external links&lt;/li&gt;
&lt;li&gt;Canonical URLs and indexing signals&lt;/li&gt;
&lt;li&gt;Structured data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The useful part is that the evaluation isn't just based on how the website looks in a screenshot. It examines the on-page elements that search engines use to understand a website.&lt;/p&gt;

&lt;p&gt;After running it, I received a report showing which elements were already in good shape and which could benefit from changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My starting score: 77/100.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://preveo.io/results/a05b4996-e0a1-485e-ad67-48da44062696" rel="noopener noreferrer"&gt;View my original SEO evaluation&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Understand What Was Actually Hurting the Score
&lt;/h2&gt;

&lt;p&gt;Going through the findings reminded me that good SEO isn't necessarily about adding more keywords or writing longer content.&lt;/p&gt;

&lt;p&gt;Sometimes, it's about making the website easier to understand.&lt;/p&gt;

&lt;p&gt;Here are five lessons I took away from the process.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Your Headline Should Explain What You Do
&lt;/h3&gt;

&lt;p&gt;A catchy headline is great for marketing, but visitors and search engines also need to understand what your product actually offers.&lt;/p&gt;

&lt;p&gt;It communicates an idea, but without supporting context, it doesn't fully explain the product.&lt;/p&gt;

&lt;p&gt;A descriptive subheading can help connect that message to what the product does and who it's for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; Keep your creative messaging, but make sure the surrounding content provides clarity.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Meta Descriptions Deserve Attention
&lt;/h3&gt;

&lt;p&gt;It's easy to spend hours designing a landing page and almost no time reviewing how it might appear in search results.&lt;/p&gt;

&lt;p&gt;Your page title and meta description are an opportunity to explain why someone should click.&lt;/p&gt;

&lt;p&gt;A good description should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communicate what the page offers.&lt;/li&gt;
&lt;li&gt;Use natural language.&lt;/li&gt;
&lt;li&gt;Match the actual content.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary keyword stuffing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Image Descriptions Matter
&lt;/h3&gt;

&lt;p&gt;Not every image needs a long description, but meaningful images should have relevant alt text.&lt;/p&gt;

&lt;p&gt;This helps accessibility and gives search engines additional context.&lt;/p&gt;

&lt;p&gt;For purely decorative images, an empty alt attribute can be more appropriate.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Your Content Needs a Clear Structure
&lt;/h3&gt;

&lt;p&gt;A website can look visually organized while having a confusing heading hierarchy underneath.&lt;/p&gt;

&lt;p&gt;Using headings consistently helps visitors navigate content and makes the page structure easier for search engines to interpret.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Small Technical Details Are Easy to Miss
&lt;/h3&gt;

&lt;p&gt;Canonical URLs, indexing directives, structured data, and descriptive links aren't always visible in the UI.&lt;/p&gt;

&lt;p&gt;That's exactly why reviewing the actual webpage matters.&lt;/p&gt;

&lt;p&gt;A visual inspection alone won't tell you whether everything is configured correctly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Generate One Fix Prompt Instead of Fixing Everything Manually
&lt;/h2&gt;

&lt;p&gt;This was my favorite part of the experiment.&lt;/p&gt;

&lt;p&gt;Once I had the SEO evaluation, I used its findings to create an AI fix prompt.&lt;/p&gt;

&lt;p&gt;The idea was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rather than manually translate every recommendation into a code change, give a coding agent the relevant evidence and ask it to handle the confirmed issues.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I copied the prompt into &lt;strong&gt;Codex&lt;/strong&gt;, which had access to my website's codebase.&lt;/p&gt;

&lt;p&gt;The prompt instructed the agent to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Review the SEO evaluation findings.&lt;/li&gt;
&lt;li&gt;Verify each issue against the actual implementation.&lt;/li&gt;
&lt;li&gt;Identify which recommendations were genuinely necessary.&lt;/li&gt;
&lt;li&gt;Make the appropriate code changes.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary changes just to improve the score.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That verification matters.&lt;/p&gt;

&lt;p&gt;AI-generated reports aren't automatically correct, and I didn't want changes made simply because a tool suggested them.&lt;/p&gt;

&lt;p&gt;The coding agent could inspect the existing implementation before editing anything.&lt;/p&gt;

&lt;p&gt;After the changes, I pushed the updated website and ran the same SEO evaluation again.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Run the Evaluation Again
&lt;/h2&gt;

&lt;p&gt;This was the moment I was most interested in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did the changes actually improve anything?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The second evaluation came back with a score of &lt;strong&gt;96/100&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Before vs. After
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SEO evaluation score&lt;/td&gt;
&lt;td&gt;77/100&lt;/td&gt;
&lt;td&gt;96/100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Score improvement&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;+19 points&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evaluation method&lt;/td&gt;
&lt;td&gt;Preveo SEO Macro&lt;/td&gt;
&lt;td&gt;Same macro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Code improvements&lt;/td&gt;
&lt;td&gt;Not yet applied&lt;/td&gt;
&lt;td&gt;Applied using Codex&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://preveo.io/results/6763dd4d-a782-490c-bc76-c9cda66737f6" rel="noopener noreferrer"&gt;View my updated SEO evaluation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One important distinction:&lt;/strong&gt; This was an improvement in the evaluation score, not proof of a 19% increase in Google rankings or organic traffic.&lt;/p&gt;

&lt;p&gt;Search performance takes time to measure, and better on-page SEO doesn't guarantee better rankings.&lt;/p&gt;

&lt;p&gt;But it did give me a measurable way to see whether the changes addressed the issues identified in the first review.&lt;/p&gt;

&lt;p&gt;And that's valuable on its own.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Workflow I Want to Keep Using
&lt;/h2&gt;

&lt;p&gt;The whole experience made me think differently about improving websites with AI.&lt;/p&gt;

&lt;p&gt;We have plenty of tools that help us build websites quickly.&lt;/p&gt;

&lt;p&gt;Lovable, Bolt, Replit, Cursor, Claude Code, and Codex are all examples of how much easier building has become.&lt;/p&gt;

&lt;p&gt;But once the website is built, there's another question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you know what still needs improvement?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's where I think an evaluation-first workflow makes sense.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Process
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Evaluate → Understand → Generate Fix Prompt → Apply Fixes → Re-evaluate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used &lt;a href="https://preveo.io/" rel="noopener noreferrer"&gt;Preveo&lt;/a&gt; for the evaluation and &lt;strong&gt;Codex&lt;/strong&gt; to make the code changes.&lt;/p&gt;

&lt;p&gt;The distinction is useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Preveo:&lt;/strong&gt; Identifies what needs attention and generates actionable findings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Codex:&lt;/strong&gt; Reviews the findings, verifies the issues, and implements the code changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preveo again:&lt;/strong&gt; Re-evaluates the website to measure the improvement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It also means I don't have to rely entirely on how polished the page looks or whether the coding agent says it's finished.&lt;/p&gt;

&lt;p&gt;I can run another evaluation after making changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Few Things I'd Do Differently Next Time
&lt;/h2&gt;

&lt;p&gt;I learned that a higher score shouldn't be the only goal.&lt;/p&gt;

&lt;p&gt;Some SEO recommendations may not be appropriate for every page, and adding unnecessary keywords, sections, or structured data just to satisfy a checklist can make the website worse.&lt;/p&gt;

&lt;p&gt;Next time, I'd also track:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google Search Console impressions&lt;/li&gt;
&lt;li&gt;Organic search clicks&lt;/li&gt;
&lt;li&gt;Indexing status&lt;/li&gt;
&lt;li&gt;Search queries and ranking changes&lt;/li&gt;
&lt;li&gt;Actual organic traffic over time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That would help distinguish improvements in on-page SEO implementation from actual changes in search performance.&lt;/p&gt;

&lt;p&gt;I'd also prioritize recommendations that genuinely help visitors understand and use the website, rather than treating every possible optimization as mandatory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Going from &lt;strong&gt;77 to 96&lt;/strong&gt; was satisfying, but the bigger takeaway was the workflow.&lt;/p&gt;

&lt;p&gt;I didn't need to manually inspect every metadata field or write individual instructions for each issue.&lt;/p&gt;

&lt;p&gt;I could evaluate the page, identify meaningful improvements, let a coding agent implement the verified fixes, and run the evaluation again.&lt;/p&gt;

&lt;p&gt;If you're building a website using &lt;strong&gt;Lovable, Bolt, Replit, Codex&lt;/strong&gt;, or any other AI-assisted development tool, I'd recommend trying an evaluation before asking the AI to make random improvements.&lt;/p&gt;

&lt;p&gt;You might find problems you didn't even know to look for.&lt;/p&gt;

&lt;p&gt;And sometimes, one well-structured fix prompt is enough to make a noticeable difference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources From My Experiment
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://preveo.io/macros/Improve-Page-SEO-XStnmf" rel="noopener noreferrer"&gt;Improve Page SEO — the evaluation macro I used&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://preveo.io/results/a05b4996-e0a1-485e-ad67-48da44062696" rel="noopener noreferrer"&gt;Before: SEO evaluation scoring 77/100&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://preveo.io/results/6763dd4d-a782-490c-bc76-c9cda66737f6" rel="noopener noreferrer"&gt;After: SEO evaluation scoring 96/100&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>seo</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
