CSS Function Summary

Source: Internet
Author: User

CSS functions

There are several common functions of CSS:

function Description
attr () Returns the properties of the selected element
Calc () Returns the computed CSS property values, which can be used to dynamically calculate the length or width of the element.
Linear-gradient () Creates an image of a linear gradient (sets the background color of the gradient to the element)
Radial-gradient () Create an image of a radial gradient (diverging gradients)
Repeating-linnear-gradient () Create an image with a repeating linear gradient
Repeating-linnear-gradient () Create an image with a repeating radial gradient

The practice of CSS functions
View Rendering Effects
CSS Reference Manuals

  <ahref="HTTPS://CODEPEN.IO/SIALIA/PROJECT/EDITOR/XPRDMV">Point me, link is my href attribute</a>  <scriptsrc="Scripts/index.js"></script>  <divclass="Linear-box">CSS gradient function linear-gradient ()</div>  <divclass="Repeating-linear-box">CSS gradient function repeating-radial-gradient ()</div>  <divclass="Repeating-radial-box">CSS gradient function repeating-radial-gradient ()</div>  <divclass="Radial-box">CSS gradient function repeating-radial-gradient ()</div>  <divclass="T1"></div>    <divclass="T2"></div>

Here is the CSS style

A: After {  content: ' "'attr (HREF)' "';}. T1,. T2,. Linear-box,. Repeating-linear-box,. Repeating-radial-box,. Radial-box{  Width: 400px;  Height: 400px;  text-align: Center;  Line-height:400px;  Margin-top: 50px;  Border-radius:50%;}. Linear-box{  background:Linear-gradient (#f01f98,#8490da,#28a943);}. Radial-box {  background:Radial-gradient (#d358da,#785a54,#890123);}. Repeating-radial-box {  background:Repeating-radial-gradient (#131545 20%,Red 10%,#ea8943 30%);}. Repeating-linear-box {  background:Repeating-radial-gradient (#f00,#ff0 10%,#f00 15%,#ff0 25%,#f00 30%,#ff0 40%,#f00 45%,#ff0 55%,#f00 60%,#ff0 70%,#f00 75%,#ff0 85%,#f00 90%,#ff0);}. T1 {  background:Repeating-linear-gradient (ToBottom  Left,#f24980 10%,#de5894 15%);}. T2 {  background:Repeating-linear-gradient (130deg,#f00,#de5d45 10%,#de5456 15%);}
Grammar

Calc () = Calc (arithmetic)

Description

Used to dynamically calculate length values.
Note that you need to keep a space before and after the operator, for example: Width:calc (100%-10px);
Any length value can be calculated using the Calc () function;
The Calc () function supports "+", "-", "*", "/" operations;
The Calc () function uses standard mathematical precedence rules;
----------------------------------------------------------
Specific instructions for using other functions
Image-related functions

CSS Function Summary

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.