CSS Learning Basics Detailed (Common)

Source: Internet
Author: User

Backgrounds and Borders

1. Background

Selecting with a class

. class Name {

Background: color;

}


2. Border

Select with Class

. class Name {

Background: color;

BORDER:NPX Solid color code

}

Solid can be replaced with a dased line for dot-like


Common styles

The text size. Text thickness, and font

1.FONT-SIZE:NPX;

2.font-weight: Bold Normal

3.font-family: "";

Text color, text alignment, text decoration

1.color:;

2.text-align:;left Right Center

3.text-decoration:none; Rarely used, generally used in the underline of clearly linked text


Box model (Box model)

WIDTH:NPX;

HEIGHT:NPX;

Background:;

PADDING:NPX; Inner margin

margin:npx; outer margin


Margin

Border

Padding


Positioning

1.bsolute

Creates an absolutely positioned element that is positioned relative to the first parent element other than the static anchor.

The position of the element is defined by the "left", "Top", "right" and "bottom" attributes.

2.fixed

Generates an absolutely positioned element that is positioned relative to the browser window.

The position of the element is defined by the "left", "Top", "right" and "bottom" attributes.

3.relative

Creates a relative positioned element, positioned relative to its normal position.

Therefore, "left:20" adds 20 pixels to the left position of the element.

4.static default value. No positioning, elements appear in the normal stream (ignoring top, bottom, left, right, or z-index declarations).

5.inherit Specifies that the value of the position property should be inherited from the parent element.


Clear floating

Float:;left Right Center

Clear floating clear:both;


This article from "Big Plum" blog, declined reprint!

CSS Learning Basics Detailed (Common)

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.