Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Creation Of Web Page Using Gradient Linear Effect In HTML5
WhatsApp
Alagunila Meganathan
Aug 20
2016
737
0
1
LinearGradient.rar
<!DOCTYPE html
>
<
html
>
<
body
>
<
h1
>
Gradient Linear Effect in Webpage
</
h1
>
<
canvas
id
=
"myCanvas"
width
=
"200"
height
=
"100"
style
=
"border:1px solid #d3d3d3;"
>
Your browser does not support the HTML5 canvas tag.
</
canvas
>
<
script
>
var
c
=
document
.getElementById("myCanvas");
var
c
cctx
= c.getContext("2d");
// Create gradient
var
grd
=
ctx
.createLinearGradient(0, 0, 200, 0);
grd.addColorStop(0, "red");
grd.addColorStop(1, "white");
// Fill with gradient
ctx.fillStyle
=
grd
;
ctx.fillRect(10, 10, 150, 80);
</
script
>
</
body
>
</
html
>
Web Page
Gradient Linear Effect
HTML5
Up Next
Creation Of Web Page Using Gradient Linear Effect In HTML5