HTML5 's Practical

Source: Internet
Author: User

1. Box Model

# 01. you can get all the tags in the current page : Remove the padding and margins from all the tabs in the current page

* {margin:0 padding:0}

# 02. Inner margin

padding:10px 8px 5px 15px; ( top , right , bottom , left )

# 03. Border

border:5px solid red; ( width , style , color )

# 04. outer margin

margin:50px 10px 20px 8px; ( top , right , bottom , left )

# 05. Box Model

Box-sizing:border-box

2 Properties of the -CSS3

# 01. Shadows

box-shadow:10px, 10px, 10px, Oringe; ( required.) The position of the horizontal shadow , required. The position of the vertical shadow , Optional. Blur the distance , optional. The color of the shadow )

# 02. rounded Corners

border-top-left-radius:100px;

border-radius:100px;

# 03. Transparency

Background-color:rgba (255, 0, 0, 1.0);( red value , green value , blue value , transparency )

3 layout of the -css

# 01.float, the label will be modified inline block-level labels , out of standard flow

Float:left;

define the ID and class within the note:

<div id= "Main" >

<div class= "Test1" > I want to left floating </div>

# 02. positioning ( sub-absolute parent phase )

Position:relatie ( generation of relatively positioned elements, child elements )

Position:fixed ( a browser that generates an absolutely positioned element )

Position:absolute ( a parent element that generates an absolute element's positioning)

# 03. Inline labels and inline block-level labels are centered

Center Horizontally : add to Parent tag : text-align:center

Center vertically : add to Parent tag : align:height

# 04. block-level label centering

" Center horizontally : set margin:0 auto in itself;

" Vertical centering : by deformation :

Position:absolute;

top:50%;

left:50%;

Transform:translate (-50%,-50%);

"<P>: block-level label , <span>: inline label , <button>: inline block-level labels

- High imitation Baidu home

# 01. where ID and class are used

<div id= "Content" >

<div class= "logo" >

# 02. Setting the background size

Background-size:cover; ( tiled )

# Set font Bold

Font-weight:bolder;

# 04. set font is not bold

Font-weight:lighter;

# 05. Remove the underline

Text-decoration:none;

# 06. Pseudo class

#header a.more-product:hover {color:red;}

# 07. change the type of label

Display:inline-block;

# 08. Set opacity

opacity:0.6;

HTML5 's Practical

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.