๐ŸŒ
CSS Gradient
cssgradient.io
CSS Gradient โ€“ Generator, Maker, and Background
As a free CSS gradient generator tool, this website lets you create a colorful gradient background for your website, blog, or social media profile.
Gradients
Looking for gradient inspiration? Youโ€™ve come to the right place. Browse our nicely curated collection of beautiful gradients in all colors: blue, red and more.
Color Shades
Color shades are lighter and darker variations of a particular color, created by adding white or black. Explore shades of red, blue, green, yellow, purple and pink.
Backgrounds
Discover the best gradient backgrounds from a curated collection of the ultimate list of gradient sites. With 1000+ gradients, it's easy to find the ๐Ÿ‘Œ color!
CSS Gradient Text
Add eye-catching gradient effects to your website text using pure CSS. Learn how to create vibrant, image-free text gradients with step-by-step syntax examples and tips.
๐ŸŒ
WebGradients
webgradients.com
WebGradients - Free CSS Gradients for Backgrounds and UI by itmeo
WebGradients is a free collection of 180 linear gradients that you can use as content backdrops in any part of your website. Easy copy CSS3 crossbrowser code and use it in a moment! We've also prepared a .PNG version of each gradient.
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css3_gradients.asp
CSS Gradients
Color stops are the colors you want to render smooth transitions among. You can also set a starting point and a direction (or an angle) along with the gradient effect. background-image: linear-gradient(direction, color-stop1, color-stop2, ...);
๐ŸŒ
Shay Howe
learn.shayhowe.com โ€บ html-css โ€บ setting-backgrounds-and-gradients
Setting Backgrounds & Gradients - Learn to Code HTML & CSS
Learn how to add background colors, images, gradients, and combinations of the two with HTML and CSS. See whats new with CSS3 background properties and values.
๐ŸŒ
CSS Gradient
cssgradient.io โ€บ gradient-backgrounds
Gradient Backgrounds โ€“ ๐ŸŒˆ The Best Gradient Sites All in One Place
Discover the best gradient backgrounds from a curated collection of the ultimate list of gradient sites. With 1000+ gradients, it's easy to find the ๐Ÿ‘Œ color!
๐ŸŒ
uiGradients
uigradients.com
uiGradients - Beautiful colored gradients
A handpicked collection of beautiful color gradients for designers and developers
๐ŸŒ
Quackit
quackit.com โ€บ html โ€บ templates โ€บ cards โ€บ background_gradient_with_centered_text.cfm
Background Gradient with Centered Text
Download a free, responsive HTML and CSS template for a bold card with a gradient background and centered text. Perfect for calls-to-action and vibrant content highlights.
๐ŸŒ
CodePen
codepen.io โ€บ P1N2O โ€บ pen โ€บ pyBNzX
๐ŸŒˆ Pure CSS Animated Gradient Background
body { background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); background-size: 400% 400%; animation: gradient 15s ease infinite; height: 100vh; } @keyframes gradient { 0% { background-position: 0% 50%; } 50% { background-position: ...
Find elsewhere
Top answer
1 of 5
8

This cannot be done in html but it can in css (specifically css3).

You would have to add a class to the body of your page or a div within it that surrounds all of your content. You can use a css gradient generator to get the code to put in your css class.

Here is a simple example on a div: http://jsfiddle.net/8fDte/

You can do the following as well if you want it on the body. Note you have to link to the css file that will store you styles.

HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
  <HEAD>
    <LINK href="PathToCss.css" rel="stylesheet" type="text/css">
  </HEAD>
  <BODY class="MyGradientClass">

  </BODY>
</HTML>

CSS

This code can be generated by a css gradient generator like the one linked above.

.MyGradientClass
{
    height:200px;
     background-image: linear-gradient(bottom, rgb(113,61,62) 25%, rgb(147,92,93) 63%, rgb(177,120,121) 82%);
    background-image: -o-linear-gradient(bottom, rgb(113,61,62) 25%, rgb(147,92,93) 63%, rgb(177,120,121) 82%);
    background-image: -moz-linear-gradient(bottom, rgb(113,61,62) 25%, rgb(147,92,93) 63%, rgb(177,120,121) 82%);
    background-image: -webkit-linear-gradient(bottom, rgb(113,61,62) 25%, rgb(147,92,93) 63%, rgb(177,120,121) 82%);
    background-image: -ms-linear-gradient(bottom, rgb(113,61,62) 25%, rgb(147,92,93) 63%, rgb(177,120,121) 82%);

    background-image: -webkit-gradient(
        linear,
        left bottom,
        left top,
        color-stop(0.25, rgb(113,61,62)),
        color-stop(0.63, rgb(147,92,93)),
        color-stop(0.82, rgb(177,120,121))
    );   
}โ€‹

Edit:

As Rory mentioned, CSS3 is not fully supported by all modern browsers. However, there are some tools such as PIE CSS to help IE to accept some CSS3 functionality.

2 of 5
2

It's not possible to make a gradient with HTML alone. There are new features in CSS3 which allow you to create a gradient, however these are not fully supported by all browsers.

If you'd like to read some more about CSS3 gradients, read this article

There is also a handy online tool which will create the CSS code to create a gradient of your specification, here.

๐ŸŒ
ColorZilla
colorzilla.com โ€บ gradient-editor
Ultimate CSS Gradient Generator - ColorZilla.com
Support for full multi-stop gradients with IE9 (using SVG). Add a "gradient" class to all your elements that have a gradient, and add the following override to your HTML to complete the IE9 support:
๐ŸŒ
MakeUseOf
makeuseof.com โ€บ home โ€บ programming โ€บ 35 stylish css background gradient examples
35 Stylish CSS Background Gradient Examples
July 3, 2023 - CSS gradients provide better control and performance over using an actual image file of a gradient that you can create using tools like Adobe Illustrator. Use the background-image CSS property to declare gradients as a background.
๐ŸŒ
HTML Dog
htmldog.com โ€บ guides โ€บ css โ€บ advanced โ€บ gradients
Gradients | HTML Dog
background: linear-gradient(to right, orange, red); ... Note that the โ€œtoโ€ is excluded with angles because there isnโ€™t an explicit destination. Link To Us! If you've found HTML Dog useful, please consider linking to us.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ CSS โ€บ CSS_images โ€บ Using_CSS_gradients
Using CSS gradients - MDN Web Docs
Unlike linear gradients, you can specify the size of radial gradients. Possible values include closest-corner, closest-side, farthest-corner, and farthest-side, with farthest-corner being the default. Circles can also be sized with a length, and ellipses a length or percentage. This example uses the closest-side size value, which means the size is set by the distance from the starting point (the center) to the closest side of the enclosing box. ... .radial-ellipse-side { background: radial-gradient( ellipse closest-side, red, yellow 10%, dodgerblue 50%, beige ); }
๐ŸŒ
Nicepage
nicepage.com โ€บ k โ€บ gradient-html-templates
Gradient HTML Templates | Nicepage
Table With Gradient HTML Template ยท Fully Responsive Templates Download ยท CSS Template For Subscribe Form On Gradient Background ยท About Me Text On Gradient - Free Template ยท Contact Form With Gradient - Responsive HTML5 Template ยท 3 Columns With Gradient Background HTML Template ยท
๐ŸŒ
ColorSpace
mycolor.space โ€บ gradient
ColorSpace - CSS Gradient Color Generator
New Feature: You can now create a gradient out of 3 colors! ... CSS Code: background-image: linear-gradient(to right top, #051937, #004d7a, #008793, #00bf72, #a8eb12);
๐ŸŒ
W3Schools
w3schools.com โ€บ cssref โ€บ func_linear-gradient.php
CSS linear-gradient() function
#grad { background-image: linear-gradient(to right, rgba(255,0,0,0), rgba(255,0,0,1)); } Try it Yourself ยป ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com ยท ...
๐ŸŒ
Gravitypdf
docs.gravitypdf.com โ€บ backgrounds
Custom Template Background Colour, Gradient and Image Support in PDFs | Gravity PDF
December 11, 2025 - However, some gradient line definitions like to right corner or to bottom left don't work as expected โ€“ but right, left, or 45degs works correctly. ... <!-- Background Linear Gradient --> <div style="background-image: linear-gradient(red, orange); height: 20mm"> This is my content </div> <!-- Left-To-Right Background Linear Gradient --> <div style="background-image: linear-gradient(right, red, orange); height: 20mm"> This is my content </div> <!-- Diagonal Background Linear Gradient --> <div style="background-image: linear-gradient(45deg, red, orange); height: 20mm"> This is my content </div> <!-- Multi-colour Linear Gradient --> <div style="background-image: linear-gradient(left, red, #f06d06, rgb(255, 255, 0), green); height: 20mm"> This is my content </div>