- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Setting Direction of Linear Gradients using Angles in CSS
For more control overt the direction of the gradient, define angle as in the below syntax −
background-image: linear-gradient(angle, color-stop1, color-stop2);
Following is the code for setting the direction of linear gradients using angles in CSS −
Example
<!DOCTYPE html> <html> <head> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } div { height: 200px; width: 300px; display: inline-block; margin-right: 10px; } .linearGradient { background-image: linear-gradient(90deg, rgb(255, 0, 200), yellow); } .linearGradient1 { background-image: linear-gradient(-90deg, rgb(255, 0, 200), yellow); } </style> </head> <body> <h1>Linear Gradient direction using angles</h1> <div class="linearGradient"></div> <div class="linearGradient1"></div> </body> </html>
Output
The above code will produce the following output −
- Related Articles
- How to use angles on linear gradients using CSS
- Setting the shape of the radial gradients using CSS
- Setting the size of the radial gradients using CSS
- Creating Linear Gradients using Multiple Color Stops in CSS
- How to repeat linear gradients with CSS
- Using the CSS3 Linear and Radial Gradients
- CSS3 Linear gradients
- Types of Gradients in CSS
- Arrange two or more colors in linear formats using CSS3 Gradients
- Setting Text Color using CSS
- Setting Line Height using CSS
- Setting Background Position using CSS
- Setting Text Alignment using CSS
- Setting Background Image using CSS
- Setting the Color of Links using CSS

Advertisements