CSS3 Basic Knowledge Collation

Source: Internet
Author: User

1. Border

(1) box round corner bored-radius:25px/40%;

border-radius:15px 10px 7px 2px;-----order is upper left, upper right, bottom right, left down clockwise

(2) Box Shadow Box-shadow---------------

Box-shadow:x axis offset + y offset + shadow blur radius (blur degree of shadow color) + Shadow expansion radius + shadow color + projection mode
----------------------------inset means that the shadow is inside the box, the default is outside, the inset is written to the first or last parameter position, and the other position is invalid.

box-shadow:5px 5px 5px Black-----A value of 3, indicating the distance to the left, the upper side of the distance, the shadow color

box-shadow:5px 5px 5px 5px black--------4 values, indicating the distance to the left, the top of the distance, the imaginary pixels, the shadow color

box-shadow:5px 5px 5px 5px 5px Black--------------5 values, indicates the distance from the left, the upper side of the distance, the imaginary pixels, the shadow color, whether it is displayed internally and inverts the color

2. Background

(1) background size background-size

-------------------Auto Default picture size, does not change picture size

------------------cover fills the entire outer container

(2) background tile background-repeat:norepeat

(3) Background position

-----------Backgrounf-origin Use this property, you must set the background to No-repeat

--------------------------Background-origin:content-box based on text position

--------------------------Background-origin:border-box based on border position

-------------------------Background-origin:p Adding-box based on the internal margin position

------------background-position

---------------------------Top

---------------------------Bottom

---------------------------Left

---------------------------Right

-----------------------------background-position:11111px 11111px--------from left 11111px to right 1111px.

(4) Multiple background---------------- comma split: Background-image:url (images/bg_flower.gif), url (images/border.png); background-repeat:no-repeat;

3. Font

(1) Text Shadow

-----------------------Text-shadow: Three values: The left side of the distance, the upper side of the distance, the shadow color shadow will display the text

-----------------------Text-shadow: Four values: representing the distance to the left, the upper side of the distance, the degree of blur and the shadow color--

(2) Text Overflow property

---------------------------Overflow:hidden; White-space:nowrap the text to force no line break to set both properties first

----------------------------text-overflow ellipsis: Display ellipses to represent trimmed text

---------------------------ellipsis: Display ellipses to represent trimmed text

(3) Text Wrapping property Word-break:

---------------------------Word-break:break-all If there is a long English word at the end of the line (congratulation, etc.), it truncates the word to the end of the line as Conra ( Congratulation the front-end part),

The backend portion of the next behavior tulation (conguatulation).

---------------------------Word-break:break-word; It will congratulation the whole word as a whole, and if the end of the line is not wide enough to display the whole word, it will automatically put the whole word on the next line without truncating the word.

4. Color Gradient background-image:linear-gradient (to bottom, #fff, red);

The first parameter specifies the direction of the gradient to Top,to bottom,to right,to left,to top left ...

Second and third parameters: is to specify that the start and end color values can have multiple colors background-image:linear-gradient (to bottom, #fff, black,red);

5. Pictures

(1) Picture fillet

(2) Image response style

(3) Image Shadow Box-shadow

(4) Image filter

Filter:blur (4px); Blur effect
Filter:brightness (5); lighten
Filter:contrast (300%); contrast ratio
Filter:grayscale (50%);
Filter:hue-rotate (180deg); Hue rotation
Filter:invert (100%); invert input image
Filter:opacity (50%); transparency
Filter:saturate (7); saturation
Filter:sepia (100%); dark brown
Filter:drop-shadow (8px 8px 10px green); shadow effect

6. Rotating Transform

(1) 2D

---------------------- transform-rotate (deg) rotates 30 degrees clockwise, negative is counterclockwise, deg represents the degree

----------------------Translate ()-moves from the current position with an X, Y value in parentheses. Allow negative values, move the transform:translate in the opposite direction (30px,30px): Right 30px, down 30px move, original position saved

------------------------Transform:scale (2,4) changes the original size, in multiples, the brackets are a multiple of width, height, transform:scale (2,4): Width becomes twice times, The height becomes 4 times times

------------------------Transform:skew (30deg,30deg)

Skew ()--torsion in horizontal and vertical direction, horizontal twist angle in brackets, vertical twist angle
Transform:skew (30deg,0deg); Will twist the 30 degree div horizontally, the inner text will follow the twist
Transform:skew (0deg,30deg); The 30-degree div will be rotated vertically, and the inner text will follow the twist
Transform:skew (30deg,30deg); a div with a horizontal twist of 30 degrees and a longitudinal twist of 30 degrees, the inner text will follow the twist

-------------------Transform:skew (30DEG,0DEG);

------------------------Transform:skew (0deg,30deg)

-----------------------Transform:skew (30deg,30deg)

(2) 3D

7. Transition

(1) Transition: Specially dealing with the transition of color, length, width, position, etc.

Usage:

Spents 2 seconds width from 200px to 800px: (after rotating 60 degrees along the y axis, the width passes to 2 seconds from 200px to 800px)

8. Animation

#date7 {
width:100px;
height:100px;
background:red;
position:relative;
Animation:myfirst 5s;
Animation:myfirst 5s;
}
@keyframes myfirst{
0% {background:red; left:0px; top:0px;}
25% {background:yellow; left:200px; top:0px;}
50% {background:blue; left:200px; top:200px;}
75% {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}

9. Flexible box (available when navigating)

(1) Define elastic box Display:flex; Consider browser compatibility issues

(2) Flex-direction the position of the elastic child elements in the parent container (Landscape, Portrait)

----------------------row: Horizontal left-to-right (left-aligned), the default arrangement.

----------------------Row-reverse: Reverses the horizontal arrangement (right-aligned, from rear to front, and last to the front.)
---------------------column: vertical arrangement.
----------------------Column-reverse: Reverses the longitudinal arrangement, from the back to the front row, the last item on top.

A defined div:

<div id= "Date8" >
<div class= "Hour" >1</div>
<div class= "Hour" >2</div>
<div class= "Hour" >3</div>
<div class= "Hour" >4</div>
<div class= "Hour" >5</div>
</div>

CSS3 Basic Knowledge Collation

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.