Learn how to create Gradient Backgrounds using CSS
Make money for being or staying online/internet.

You will get a $50 starting gift when you join using this code: Exode4LKrbujm1z and link:: GET THE OFFER NOW!!

As you might know, HTML5 introduced many exciting features for Web developers. One of the features is the ability to specify gradients using pure CSS3, without having to create any images and use them as repeating backgrounds for gradient effects.

Gradients let you display smooth transitions between two or more specified colors.

The linear-gradient() CSS function creates an image consisting of a progressive transition between two or more colors along a straight line.

More so, Its result is an object of the gradient data type, which is a special kind of image.

Tutorial

To follow the tutorial above, create two files i.e index.html and style.css and add the code below respectively.

HTML

Add this code in the body section of your html document(index.html).

copy


   <div class="container">

     <div class="box"> </div>
     <div class="box"> </div>
     <div class="box"> </div>
     <div class="box"> </div>

   </div>


CSS

Add this code in the style.css file you created and link to it in the head section of the index.html file.

copy

body{
margin:0;
padding:0;
box-sizing: border-box;
}

.container{
max-width: 80%;
margin:0 auto;
display: grid;
grid-template-columns: repeat(4,1fr);
grid-gap:10px;
}


.box{
width:100px;
height:150px;
margin-top:250px;

/*Fallback color incase all fail.*/
background-color:#333;

/*For Old Browsers.*/
background-image:-webkit-gradient(linear, left top, left bottom, from(#333),to(#fff));
background-image:-webkit-linear-gradient(top,#333,#fff);
background-image:-o-linear-gradient(top,#333,#fff);
background-image:-ms-linear-gradient(top,#333,#fff);
background-image:-moz-linear-gradient(top,#333,#fff);

/*Upto date Browsers.*/
background-image:linear-gradient(to bottom,#333,#fff);
}
	

You See gradients were super played out back in the early web days, but now they’re so ubiquitous that you’d be remiss not to drop them in your site or interface. So have fun trying out new gradient backgrounds.

Save up to 80% with this Domain & Shared Hosting package deal! 80% OFF - GET OFFER NOW

Related Post(s)

» Animated Social Media Icons Using Font Awesome and Materialize CSS

» CSS explained in a few lines

» How To Create A Stacked Gallery Using HTML And CSS Source Code

» Creating A Pure CSS Preloader - Source Code

» How to use the CSS Negation and Language Selectors.

collections_bookmark Category :: Css
date_range Published :: 3 years ago At: 01:04 AM
event_note Detailed Date :: Jun 01st, 2020
person Writer :: Code
  • RECENT POSTS
3 days ago

Mr.

(sel


3 days ago

Mr.

(sel


3 days ago

Mr.

555


3 days ago

Mr.

555


3 days ago

Mr.

5550


3 days ago

Mr.

5550


3 days ago

Mr.

555


3 days ago

Mr.

555


Subscribe
  • ADVERTISEMENT

YOU MAY LIKE THESE POSTS

share