How to make gradients with CSS3 - Printable Version +- QP School (https://qomplainerzschool.lima-city.de) +-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3) +--- Forum: CSS3 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=5) +--- Thread: How to make gradients with CSS3 (/showthread.php?tid=5163) |
How to make gradients with CSS3 - Qomplainerz - 07-26-2023 Example: <!DOCTYPE html> <html> <head> <title>Gradients Example</title> <style> /* Apply a linear gradient background to the div element */ div { width: 200px; height: 100px; background-image: linear-gradient(to right, lightblue, lightgreen); } </style> </head> <body> <div>This div has a gradient background.</div> </body> </html> Explanation: CSS background-image property can be used to create gradients. In this example, a linear gradient is applied to the div element, starting with the color light blue on the left and transitioning to light green on the right. |