• Home
  • Web Designing
    • Html
    • Css
    • Php
  • Graphics Designing
    • Illustration
    • Adobe Photoshop
    • Coral Draw
  • Fonts
  • Downloads
  • About us
  • Contact us
facebook Google+ instagram Email

Designtech4u

Learn Web and Graphics Designing Tips And Tricks



What is Gradients?

Gradients displays the combination of two or more colors as shown below −

Types of gradients

  • Linear Gradients(down/up/left/right/diagonally)
  • Radial Gradients

Linear gradients

Linear gradients are used to arrange two or more colors in linear formats like top to bottom

Top to bottom

<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            background: -webkit-linear-gradient(pink,green);
            background: -o-linear-gradient(pink,green);
            background: -moz-linear-gradient(pink,green); 
            background: linear-gradient(pink,green); 
         }
      </style>
   </head>
   <body>
      <div id="grad1"></div>
   </body>
</html> 
It will produce the following result −

Left to right

<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            background: -webkit-linear-gradient(left, red , blue);
            background: -o-linear-gradient(right, red, blue); 
            background: -moz-linear-gradient(right, red, blue);
            background: linear-gradient(to right, red , blue);
         }
      </style>
   </head>
   <body>
      <div id="grad1"></div>
   </body>
</html> 
It will produce the following result −

Diagonal

Diagonal starts at top left and right button
<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            background: -webkit-linear-gradient(left top, red , blue); 
            background: -o-linear-gradient(bottom right, red, blue); 
            background: -moz-linear-gradient(bottom right, red, blue);
            background: linear-gradient(to bottom right, red , blue); 
         }
      </style>
   </head>
   <body>
      <div id="grad1"></div>
   </body>
</html> 
It will produce the following result −

Multi color

<html>
   <head>
      <style>
         #grad2 {
            height: 100px;
            background: -webkit-linear-gradient(red, orange, yellow, red, blue, green,pink); 
            background: -o-linear-gradient(red, orange, yellow, red, blue, green,pink); 
            background: -moz-linear-gradient(red, orange, yellow, red, blue, green,pink); 
            background: linear-gradient(red, orange, yellow, red, blue, green,pink); 
         }
      </style>
   </head>
   <body>
      <div id="grad2"></div>
   </body>
</html> 
It will produce the following result −

CSS3 Radial Gradients

Radial gradients appears at center
<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            width: 550px;
            background: -webkit-radial-gradient(red 5%, green 15%, pink 60%); 
            background: -o-radial-gradient(red 5%, green 15%, pink 60%); 
            background: -moz-radial-gradient(red 5%, green 15%, pink 60%); 
            background: radial-gradient(red 5%, green 15%, pink 60%); 
         }
      </style>
   </head>
   <body>
      <div id="grad1"></div>
   </body>
</html> 
It will produce the following result −

CSS3 Repeat Radial Gradients

<html>
   <head>
      <style>
         #grad1 {
            height: 100px;
            width: 550px;
            background: -webkit-repeating-radial-gradient(blue, yellow 10%, green 15%); 
            background: -o-repeating-radial-gradient(blue, yellow 10%, green 15%);
            background: -moz-repeating-radial-gradient(blue, yellow 10%, green 15%);
            background: repeating-radial-gradient(blue, yellow 10%, green 15%); 
         }
      </style>
   </head>
   <body>
      <div id="grad1"></div>
   </body>
</html> 
Share
Tweet
Pin
Share
No comments
Older Posts

Categories

  • Add a “Back To Top” Button
  • Adobe illustrator CS6
  • Banner Fonts
  • Best Fonts
  • Brush Fonts
  • Brushes
  • CSS shadow property
  • CSS3 Gradients
  • Coral Draw X7
  • Designer Fonts
  • Fonts
  • Photoshop Actions
  • Photoshop Actions Packs
  • Photoshop CS6 Download
  • Smoke Brushes
  • Tricks For Html
  • Valentine’s Day Fonts

Follow Us

  • facebook
  • Google+
  • youtube

recent posts

About Me

Unknown
View my complete profile

Facebook

Contact Form

Name

Email *

Message *

Created by ThemeXpose |Blog DESIGNTECH4U