CSS3 Gradient Background

Source: Internet
Author: User

The gradient of CSS3 is divided into two types: linear gradient (linear) and radial gradient (radial).

First, linear gradient linear-gradient

1. Introduction

Linear-gradient ([Set direction],[set start color],[set various over color],[set End color])

Parameters:

First parameter: Specifies the direction of the gradient, which can be expressed as the "angle" keyword or "English":

The first parameter defaults to: 180deg, which is the same as "to bottom".

The color behind is at least 2, which is the start color and end color.

2. Use

A, for example:

<style type= "Text/css" >p{    width:300px;    height:100px;    Background-image:linear-gradient (to right, red, orange, yellow, green, blue, indigo, violet);} </style><p> left-to-right linear gradient background </p>

b, a very cool feature: Use the gradient to make the navigation split line

Background:linear-gradient (to bottom, #dd2926, #a82724, #dd2926) no-repeat right/1px 15px; The meaning background uses the gradient color, then does not repeat, the right, the slash behind is actually the background-size setting, Width 1px,height 15px
View Code

Effect:

C, Google search low-key linear gradient background

Check out a Google search code and write an example

View Code

Two, radial gradient radial-gradient

Cond

CSS3 gradient written in the desert

Http://www.w3cplus.com/content/css3-gradient

CSS3 Gradient Background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.