Welcome Guest! (App Version 3.1)

websitnero logo name

Linear Gradients

Adding Linear Gradient as Backgrounds

Linear Gradient is first type of gradient in CSS3. For this you only need to specify 2 colors as endpoints and default direction is from Top to Bottom. However, you can always use more than 2 colors and also set direction as per your needs.

Example

<head>
<style>
div{
  width:300px;
  height:200px;
  background:linear-gradient(yellow,blue);
}
</style>
</head>

<body>
  <div>This is a div.</div>
</body>

Example

<head>
<style>
div{
  width:300px;
  height:200px;
  background:linear-gradient(left, yellow,blue);
}
</style>
</head>

<body>
  <div>This is a div.</div>
</body>

Example

<head>
<style>
div{
  width:300px;
  height:200px;
  background:linear-gradient(left top, yellow,blue);
}
</style>
</head>

<body>
  <div>This is a div.</div>
</body>

Example

<head>
<style>
div{
  width:300px;
  height:200px;
  background:linear-gradient(red, yellow, blue);
}
</style>
</head>
<body>
  <div>This is a div.</div>
</body>
WebsiteNero is highly optimized for learning various website developing technlogies. We try our best to add maximum modules and examples to help learn the concepts clearly and vividly. We try to present all content and examples as simple as we can removing any complexity to hurdle easy understanding. We try best provide you with worthful content, but we cannot guarantee full correctness of all the content on this site. While using this website, you agree to have read and accepted all our terms of use and conditions, cookie, and privacy policy. Copyright, 2013-2018 by websitenero.com. All Rights Reserved.