When a CSS style sheet encounters Layer 2

Source: Internet
Author: User

9. Display properties of the custom layer:
The performance of the layer is achieved through the structure of the box. A box can be a block-level object or an inline object. The display property is used to control whether the content is block-level or row-level.
Defined as block is the Kuai block level, and inline B behaves Wei as the row level, the default is None.

<HTML>    <Head>        <title>Display Properties</title>        <styletype= "Text/css">Body{text-align:"Center";Font:80% blackbody;            }H1{font-size:2em;            }H2{font-size:1.5em;            }#kuai, #hang{background:Silver;Border:2px solid Black;            }span{background: White;Display:Block;Border:0.5em Dashed Green;padding:1em;margin:0.5em;            }Span.yanse{background:Yellow;            }#hang span{Display:inline;            }        </style>    </Head>    <Body>        <H1>Blocks and rows</H1>        <H2>Block</H2>        <PID= "Kuai"><span>Beijing</span><spanclass= "Yanse">Shanghai</span><span>Hong kong</span><spanclass= "Yanse">Hainan</span></P>        <H2>Yes</H2>        <PID= "Hang"><span>Beijing</span><spanclass= "Yanse">Shanghai</span><span>Hong kong</span><spanclass= "Yanse">Hainan</span></P>    </Body></HTML>

0.css Hack:
Different browsers are based on different kernels, and the parsing of CSS is not the same. This directly results in a different page effect for the build. For example, the most direct impact is reflected in the frame model of the distance of understanding. How can i solve a browser-compatible problem? You can only write a different style sheet for different browsers, which is called CSS Hack

Although there are many hack for different browsers, the solution is available. When it comes to solving different layouts in IE and Firefox browsers, one of the most common is!important. Since!important is not supported by IE, other browsers can support it.

<HTML>    <Head>        <title>CSS Hack</title>        <style>. Select{Border:20px Solid Navy!important;width:230px!important;padding:20px!important;Border:20px Solid Orange;width:300px;padding:20px;Font:1.5em new song Body;text-align:"Center";            }        </style>    </Head>    <Body>        <Divclass= "Select">The effect in Firefox is a blue border, its width is set to 14em, and the effect in the IE10 browser is an orange border.</Div>    </Body></HTML>

When a CSS style sheet encounters Layer 2

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.