What Is Linear Gradient in CSS
✅linear Gradient in CSS function that creates a smooth transition between
✅Two or more colors along a straight line
✅ linear gradient is treated as background image,not a background color.
✅Defined using the linear-gradient() function in CSS
✅Direction controls how colors flow (top,bottom,left,right or diagonal)
✅linear gradients use angles such as 45deg ,90deg,180deg
✅Angles rotate clockwise starting from bottom to top at 0deg
✅At least two colors are required to create a linear gradient.
✅Multiple color to create rich gradient effects
✅Each color in gradient is called a color stop
✅Linear gradients are resolution-independent and scale prefectly on all devices
✅They are widely used for buttons,headers , banners and background
What is Linear Gradient in CSS
Syntax
Why Use Linear Gradients?
✔ Easy to customize
✔ No Images required
✔ Improves Ul design
✔ Supported by all modern browsers
✔ Fully responsive
What is Linear Gradient in CSS
Example
What Is Linear Gradient in CSS
Explain Program
Step 1]
<!DOCTYPE html>
Step 2 ]
<html>.... . </html>
- html is the root element of the html page.
- Every thing inside it is part of the webpage.
Step 3]
- <head> section
- head section contains metadata about page. not visible on the page itself.
- <title> tag title section set the title of the page shows the browser tab
- #grad ID selector in css.
- selects HTML element that has id="grad
Step 5]
- <body> tag contains everything visible on the web page.
- Images,links, Text heading all go inside tag.
- <div id="grad">
- <div> is block-level container use to group elements.
- id=" grad" assigns unique identifier to div
- <h1> heading tag
- displays large ,bold text
- used for main titles
- text explains that gradient flows form top to bottom
- <a> is anchor tag
- href specifies the destination URL
- clicking the text open website
Step 6]
Closing tag
What is Linear Gradient in CSS
Output
Related Post :-
