พัฒนาเว็บ
CSS Gradient Generator
สร้างเกรเดียนต์แบบเชิงเส้น รัศมี หรือทรงกรวยจากหลายสี และรับ CSS ที่พร้อมใช้งาน
0° — ด้านบน จากนั้นตามเข็มนาฬิกา
A CSS gradient is a smooth transition between multiple colors, generated by the browser itself with no image needed. This tool lets you visually build a linear, radial, or conic gradient and copy the finished CSS instantly.
How to use it
- Add color stops and drag them to fine-tune where each transition happens.
- Pick a gradient type — linear (a direction in degrees), radial (shape and center position), or conic (rotation around a point).
- Copy the finished CSS with one click and paste it into background or background-image.
Common uses
- Picking a background for a hero section or button without opening a graphics editor.
- Recreating a gradient from a design mockup (Figma, etc.) in exact CSS syntax.
- Quickly experimenting with color transitions before locking a choice into a design system.
Things to keep in mind
A radial gradient defaults to stretching into the shape of its element (an ellipse), not always staying a circle — worth accounting for on rectangular blocks.
Multiple gradients can be layered by listing them comma-separated in background-image — it works like stacked layers, with the first one in the list on top.
บทความเกี่ยวกับเครื่องมือนี้: CSS Gradient: linear ต่างจาก radial และ conic อย่างไร
คำถามที่พบบ่อย
เกรเดียนต์เชิงเส้น เชิงรัศมี และทรงกรวยต่างกันอย่างไร?
เกรเดียนต์เชิงเส้นเปลี่ยนผ่านตามเส้นตรงในมุมที่เลือก เกรเดียนต์เชิงรัศมีแผ่ออกจากจุดศูนย์กลางเป็นวงกลมหรือวงรี ส่วนเกรเดียนต์ทรงกรวยกวาดสีรอบจุดศูนย์กลางเหมือนวงล้อสี
เกรเดียนต์ทรงกรวยรองรับในทุกเบราว์เซอร์หรือไม่?
เบราว์เซอร์หลักปัจจุบันทั้งหมดรองรับเกรเดียนต์ทรงกรวย แต่เป็นฟีเจอร์ CSS ที่ใหม่กว่าเกรเดียนต์เชิงเส้นหรือเชิงรัศมี ดังนั้นเบราว์เซอร์รุ่นเก่ามากอาจไม่แสดงผล
ฉันจะได้อะไรเป็นผลลัพธ์?
เครื่องมือนี้สร้างไวยากรณ์ CSS background ที่พร้อมใช้งานด้วยสี จุดหยุด และตำแหน่งที่คุณเลือก ซึ่งคุณสามารถวางลงในสไตล์ชีตได้โดยตรง
repeating-linear-gradient ต่างจาก linear-gradient ธรรมดาอย่างไร?
linear-gradient ธรรมดาจะยืดลำดับสีของมันเพียงครั้งเดียวตลอดทั้งองค์ประกอบ ในขณะที่ repeating-linear-gradient จะทำซ้ำลำดับ color stops เดิมเป็นวงจร สร้างพื้นหลังแบบแถบหรือลวดลาย
สามารถวางเกรเดียนต์หลายอันซ้อนกันเป็นพื้นหลังได้หรือไม่?
ได้ พร็อพเพอร์ตี้ background-image รองรับรายการเกรเดียนต์ที่คั่นด้วยจุลภาค และจะซ้อนกันเป็นชั้น ๆ เหมือนกับภาพพื้นหลังหลายภาพ — เกรเดียนต์แรกในรายการจะอยู่บนสุด