Đường chéo bắt đầu ở trên cùng bên trái và nút bên phải. Bạn có thể thử chạy đoạn mã sau để triển khai các gradient theo đường chéo trong CSS3 -
<html> <head> <style> #grad1 { height: 100px; background: -webkit-linear-gradient(left top, red , blue); background: -o-linear-gradient(bottom right, red, blue); background: -moz-linear-gradient(bottom right, red, blue); background: linear-gradient(to bottom right, red , blue); } </style> </head> <body> <div id = "grad1"></div> </body> </html>