CSS3 Linear Gradients and the things that you need to know

View: 2759    Dowload: 0   Comment: 0   Post by: hanhga  
Author: none   Category: References   Fields: Other

9 point/10 review File has been tested

Gradient is a color mixing features which we are familiar in working with Photoshop or other imaging software khac.Voi color gradient, we can create many beautiful background images from the different color . And now, with CSS3, you can create a gradient background color for any element.

Introduction

Gradient is a color mixing features which we are familiar in working with Photoshop or other imaging software khac.Voi color gradient, we can create many beautiful background images from the different color . And now, with CSS3, you can create a gradient background color for any element.

CSS3 Linear Gradients và những điều cần biết

To create a color gradient, you css formatting for the following elements:

1
2
3
4
5
6
7
div {
    background-image: -webkit-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: -moz-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: -ms-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: -o-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
}

We will go deep into the syntax to better understand how to use:

- First, the linear gradient function declared with linear-gradient (). This function has 3 main parameters. The first parameter defines the starting position which color will fall, and you can use the explicit value as the top (for the position at the top), left (from left) and right (from right ), bottom (bottom-up position).

1
2
3
div {
    background-image: linear-gradient(top, #FF5A00, #FFAE00);
}

Css above paragraph will fill from top to bottom as follows:

CSS3 Linear Gradients và những điều cần biết

Additionally, you can also fill positions created from different angles by using the following:

1
2
3
div {
    background-image: linear-gradient(45deg, #FF5A00, #FFAE00);
}

Css above paragraph will fill as follows:

CSS3 Linear Gradients và những điều cần biết

2nd parameter will be the first color code information and stop position (stop position) is calculated as a percentage. Place stop just a choice, that is possible or not. If you do not specify this value, the browser will default value is 0%. And the last parameter is the same as the 2nd parameter, including information also color codes and color placement will stop. If you do not stop, the location selected parameters will take the default value is 100%.

1
2
3
div {
    background-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
}

Css paragraph above none other than css paragraph above, but this time we specify the location.

CSS3 Linear Gradients và những điều cần biết

Now we will change the value of the stop position, and we will assign 50% for the first position and 51% for 2nd place.

1
2
3
div {
    background-image: linear-gradient(top, #FF5A00 50%, #FFAE00 51%);
}

CSS3 Linear Gradients và những điều cần biết

Transparency

Creating transparency in gradients is possible, we just create effects to change the color hex color mode and reduce alpha value rgba

1
2
3
div {
    background-image: linear-gradient(top, rgba(255,90,0,0.2), rgb(255,174,0,0.2));
}

Css above paragraph reduced color values down 20% and we will have this result:

CSS3 Linear Gradients và những điều cần biết

Multi Color

If you want more than 2 colors, simply insert a comma after each color is.

1
2
3
div {
    background-image: linear-gradient(top, red, orange, yellow, green, blue, indigo, violet);
}

And results obtained will be:

CSS3 Linear Gradients và những điều cần biết

Browser Support

Unfortunately at the present time, the popular browsers still do not support all features. But to be able to run on the browser, you only need to add the prefix (-webkit-, -moz-, -ms-, -o-) respectively are.

1
2
3
4
5
6
7
div {
    background-image: -webkit-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: -moz-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: -ms-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: -o-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
    background-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);
}

To specify for IE9 and older versions of IE, we need to use the filter as follows:

1
2
3
div {
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF5A00, endColorstr=#FFAE00);
}

However, the filter is limited, it does not allow insertion over 2 colors, it does not support color rgba but uses #ARGB

I hope this short article will help give much you can understand and know how to use color for the gradient of your website or blog.

Good luck!

CSS3 Linear Gradients and the things that you need to know

CSS3 Linear Gradients and the things that you need to know Posted on 15-08-2015  Gradient is a color mixing features which we are familiar in working with Photoshop or other imaging software khac.Voi color gradient, we can create many beautiful background images from the different color . And now, with CSS3, you can create a gradient background color for any element. 0.9/10 2759

Comment:

To comment you must be logged in members.

Files with category

  • Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    View: 2931    Download: 0   Comment: 0   Author: none  

    Instructions for installing and configuring Windows Live Mail on Windows 10 simple

    Category: References
    Fields: Other

    0.66666666666667/6 review
    Windows 10 pre-installed Mail application for managing personal email on the device. The latest version of this application but improved a lot and support other email accounts such as Gmail or Yahoo Mail but users almost no "salty" really with this...

  • Step by step instructions to create social networking buttons with CSS3

    View: 2034    Download: 0   Comment: 0   Author: none  

    Step by step instructions to create social networking buttons with CSS3

    Category: References
    Fields: Other

    0.5625/8 review
    CSS3 help web designers have the ability to create buttons (buttons) very nice, today I will share with you two tips decoration for button in your web becomes radiant beauty that no need to use photoshop.

  • You should understand the CSS Box Shadow

    View: 2158    Download: 0   Comment: 0   Author: none  

    You should understand the CSS Box Shadow

    Category: References
    Fields: Other

    1.0357142857143/14 review
    Effects his shadow was introduced in the previous article, however, in this article, I will guide more specific about shadow attributes, you try it with anything. First we try to learn css following paragraph:

  • How to do button movement with beautiful CSS3

    View: 1841    Download: 0   Comment: 0   Author: none  

    How to do button movement with beautiful CSS3

    Category: References
    Fields: Other

    0/6 review
    Previously to create motion effects button, you must draw the button in photoshop, then switched to flash to make it possible to move. But now you need not spend too much time doing it, all because of the emergence of CSS3.

  • Create a dropdown menu with CSS3 effects with beautiful transtions

    View: 2125    Download: 0   Comment: 0   Author: none  

    Create a dropdown menu with CSS3 effects with beautiful transtions

    Category: References
    Fields: Other

    0.375/12 review
    More of the dropdown menu you want to introduce to you, this will have the effect menu transitions (converted background of menu background from pale to dark). This menu works well on browsers like FF, Chrome, Safary, but unfortunately did not work...

  • How to hack css for all browsers you should know

    View: 1751    Download: 0   Comment: 0   Author: none  

    How to hack css for all browsers you should know

    Category: References
    Fields: Other

    1.35/10 review
    In the process of web design, which makes it the most headaches is how to design web pages that you can run on the browser. Especially when clients use the old as IE6 browser such. However, with this article, you will easily edit interface runs well...

  • Create Accordion with extremely beautiful CSS3

    View: 2190    Download: 0   Comment: 0   Author: none  

    Create Accordion with extremely beautiful CSS3

    Category: References
    Fields: Other

    0.64285714285714/7 review
    Accordion is a technique that helps you shortened the content that you want displayed on the website. It is often used for the display of submenus. In addition you can also use it for content, images. Before applying this procedure, you have to use...

  • Create the effect Hovercho images with Webkit and CSS3 is great

    View: 1872    Download: 0   Comment: 0   Author: none  

    Create the effect Hovercho images with Webkit and CSS3 is great

    Category: References
    Fields: Other

    0.75/6 review
    WebKit is one open source application framework provides the necessary components built one for your web browser. Along with CSS3, cả have contributed to very nice effect những previously only using JavaScript or JQuery thực beige.​

 

File suggestion for you

File top downloads

logo codetitle
Codetitle.com - library source code to share, download the file to the community
Copyright © 2015. All rights reserved. codetitle.com Develope by Vinagon .Ltd