TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Creation Of Web Page Using Gradient Linear Effect In HTML5
Alagunila Meganathan
Aug 20
2016
Code
711
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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