Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk4 min

How to Create Cross-Browser CSS Gradients

Create gradients with standard linear-gradient() syntax, then verify each feature against your project’s browser targets. Use prefixes only when a specific legacy browser requires them.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For modern projects, create a cross-browser CSS gradient with the standard, unprefixed linear-gradient() function, then verify the exact syntax against the browser versions your project supports. Add vendor-prefixed declarations only when a specific legacy browser in that support policy requires them.

Write a standard linear gradient

A linear gradient is an image generated from at least two color stops. Use it in an image-valued property such as background or background-image:

.hero {
  background: linear-gradient(to right, #17324d, #68b5a7);
}

The two colors are the gradient’s stops. The browser draws a smooth transition between them. You can add more stops and specify their positions to control where the colors change:

.banner {
  background: linear-gradient(135deg, #17324d 0%, #376f82 55%, #68b5a7 100%);
}

A gradient has no intrinsic dimensions: its rendered size follows the element it paints. It is an image, not a color value, so use background or background-image, not background-color.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Choose the direction and stops

You can specify a side or corner, such as to right, or provide an angle. If you omit the direction, the gradient runs from top to bottom. In CSS angle notation, 0deg points bottom to top and 90deg points left to right.

  • to right runs horizontally from left to right.
  • to bottom runs vertically from top to bottom.
  • 135deg sets a diagonal direction.

For example, these declarations use the same colors but different directions:

.horizontal {
  background-image: linear-gradient(to right, #17324d, #68b5a7);
}

.diagonal {
  background-image: linear-gradient(135deg, #17324d, #68b5a7);
}

Check compatibility against your actual browser targets

CSS gradients are broadly available across browsers; MDN describes the <gradient> type as widely available since July 2015. That broad statement does not guarantee support for every newer part of gradient syntax. Features such as color-interpolation choices can have different compatibility from a basic two-color linear-gradient().

  1. List the browser names and minimum versions your project promises to support.
  2. Identify the exact gradient syntax you plan to use, not just the function name.
  3. Check that feature against compatibility data for those targets, then test in the browsers your support policy requires.
  4. If a feature falls outside the supported set, choose a simpler gradient syntax or provide a suitable fallback.

There is no single browser-version floor that is correct for every project. Decide from your own support policy, and do not turn a broad availability statement into a claim that every syntax variation works everywhere.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Use vendor prefixes only for a defined legacy requirement

For ordinary modern CSS, write the standard declaration. Prefixes reflect historical experimental or non-standard implementations, not a universal compatibility checklist. MDN’s CSS FAQ cautions against routine use of prefixed properties on production sites; its general fallback guidance, when prefixes are required, is to put the prefixed declaration first and the standard declaration after it. MDN’s Mozilla extensions reference recommends using linear-gradient() instead of -moz-linear-gradient.

Older Safari versions illustrate why legacy syntax should be tied to a specific target: Apple’s archived Safari guide records use of -webkit-gradient() in earlier releases and support for -webkit-linear-gradient() beginning with Safari 5.1 and iOS 5.0. Those historical details are useful when maintaining old code, not a recommendation to support those releases today.

If your documented support policy genuinely requires a prefixed form, confirm the exact browser and syntax first. A generic copied list can add unnecessary declarations without solving the compatibility issue you actually have.

Generate prefixes from project targets with Autoprefixer

For a managed CSS build, configure your supported browsers with Browserslist and let Autoprefixer generate the prefixes it considers necessary for those targets. Keep standard CSS as the readable source, and review the generated output against your support policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Autoprefixer adds prefixes; it does not polyfill unsupported features. Its documentation also notes that legacy-only -webkit-gradient() input does not provide the unprefixed source needed for it to add other prefix forms. Keep modern, standard syntax in your source instead of relying on a legacy declaration to be transformed.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot a gradient that does not appear as expected

  • No background is visible: confirm the element has dimensions or content to paint, and that the declaration is on the intended element. A gradient has no intrinsic size of its own.
  • The browser rejects the declaration: check the CSS property and syntax. Use background or background-image; a gradient is not valid as a background-color value.
  • The direction looks reversed: remember that the default is top to bottom, while 0deg means bottom to top and 90deg means left to right.
  • A newer gradient feature fails only in some browsers: check that exact syntax against the project’s minimum browser versions. Compatibility for the basic function does not establish compatibility for every extension.
  • Autoprefixer emits no legacy form: verify the configured Browserslist targets and keep unprefixed gradient CSS as the input. Autoprefixer does not add polyfills or reliably reconstruct standard syntax from legacy-only -webkit-gradient().

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. It can capture a page in a browser without requiring you to set up your own screenshot browser for this task. For gradient validation, make sure the page itself is built with the CSS and browser targets you intend to check; the screenshot service does not replace compatibility checks against your support policy.

One GET request returns an image or PDF. For example, save a screenshot as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie and consent banners are accepted and removed before capture, along with supported newsletter popups and chat widgets; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server lets AI agents use screenshot tools. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.