CSS knowledge point

Source: Internet
Author: User

Some trivial knowledge points in CSS

1: Order of adding the style of tag:

<Style type = "text/CSS">

A: link {color: #006600; font-size: 30px;}/* unaccessed link green */

A: visited {color: # ff0000; font-size: 30px; text-Decoration: underline;}/* accessed link red */

A: hover {color: #000000; font-size: 30px; text-Decoration: underline;}/* hover the cursor over the link */

A: active {color: #000066; font-size: 30px; text-Decoration: none;}/* selected link blue */

The data must be written in the above sequence, otherwise the effect may not be reflected.

In css definition, A: hover must be located after a: link and a: visited !! A: active must be located after a: hover !!

2: CSS browser compatibility:

A :! Important (limited function ):

With IE7! Important Support ,! The important method is only compatible with ie6. (note the writing method. Remember that the declaration position must be in advance .)
For example:
# Example {
Width: 100px! Important;/* IE7 + FF */
Width: 103px;/* IE6 */
}

B: CSS hack method:

General height of all browsers: 100px;
IE6 dedicated _ Height: 100px;
IE7 dedicated * + Height: 100px;
IE6 and IE7 share * Height: 100px;
IE7 and FF share Height: 100px! Important;

Ie9 Height: 100px \ 9;

Note that,CodeThe order of./* FF */* ie9 */* IE8 */* IE7 */* IE6 */

* + For HTML compatibility with IE7, the following declaration must be made on the top of HTML:
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd">

Related Article

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.