CSS Precedence and positioning

Source: Internet
Author: User

Overflow Property hidden scroll auto

Hidden out of hidden

Scroll scroll bar

Auto automatically

Display Property block inline Inline-block None

Block blocks Display

Inline display in line

Inline-block dual function. Features of existing lines and blocks

It is displayed in one line and has a wide height.

None

Not displayed.

Display:none;

CSS introduces the way inline, inline, external

In-line

inside the tag, use the style= "CSS rules " directly

easy to write wrong:<p style= "color=red;" > text </p>

This place uses Colon

Embedded

written in

Writing

<style type= "Text/css" > styles </style>

External

with link, the external stylesheet file (*.css) is introduced to the current page.

Writing:

<link type= "Text/css" rel= "stylesheet" href= "*.css"/>

Rel Description, what is the relationship between the current file and the linked file

the relationship of the Stylesheet style sheet.

Href: Specifies where the style sheet file is (path)

Note: We usually use this method when we develop the website.

CSS Precedence

when CSS conflicts in time

Nearest principle

inline > inline styles > External Styles

Inline styles >id>class> labels

weight value, attribute value

Tags:1

class:10

ID:

style:1000

!important

CSS Inheritance

Text-related general inheritance. 、

borders, Width, height,margin,padding backgrounds, etc. are not inherited.

Inheritance the weight is 0

Positioning properties:position:static Fixed relative absolute

Position: (coordinates with positioning

left margin , top margin, right bottom from bottom

static, non-locating

fixed, out of normal document flow, higher than the normal element level. positioned relative to the browser window .

Relative

Relative positioning. Relative to Who? (relative to oneself, overbearing)

Absolute

Absolute positioning, relative to the nearest element with a positional property (either relative or absolute).

Out of normal document flow, higher level than normal elements.

Relative to its ancestor, there is an ancestor of the positional attribute.

if not, position relative to body .

Note: Relative positioning and absolute positioning

The outer elements are usually set relative to the position without the coordinates.

The inner element sets absolute positioning. Coordinate with the positioning coordinates.

Positioning coordinates:

Classroom Exercise: time-limited robbery

box Model: Border line, inner padding, outer Edge Distance

Border Border line

padding inner padding

Margin outer margin

Top,right Bottom Left

Total Width: (margin-left+padding-left+border-left) *2+width ( content width ).

Total width Problem Plus DTD(IE)

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Margin consolidation issues

Margin, Upper and lower merge (big eat small), left and right overlay

Common Layouts Ppt

Personal homepage

Green case (Job)

Introduction to Browser compatibility

Browser market share:Http://tongji.baidu.com/data/browser

Common compatibility tips

Initialize clears the browser default value and HACK Method:

Initialize Clear Browser default:ul,li,body{margin:0;padding:0}

. box{

Color:white;

Background:blue; /*ff,7*/

Background:red \9; /*IE6 7 8*/

*background:black; /*ie6 7*/

_background:orange;/*ie6*/

}

IE6 The treatment of bilateral distance problems

IE6 1px height DIV

How is it implemented?

The process of making a website

Do you have a domain and space?

Development website type, enterprise website, e-commerce, mobile development

Function Module selection: such as: News system, member system, product display, online payment, etc.

Template selection: Color selection

sign a contract, pay 30% for the first time

Website development

Internal testing, online testing

Customer Testing

Delivery use

Pay the balance

Contract completion

Annual Service Fee

Add features, add a forum, micro website (re-contract)

Upgrade Service

CSS Precedence and positioning

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.