[CSS] "CSS Secrets" Learning (ii)-Multiple borders

Source: Internet
Author: User

First, Box-shadow properties

Box-shadow can also be used to generate a bounding rectangle, except that it generates a projection, and it accepts the 4th value as the expansion radius, the 0 x-axis is offset by the +0 y-axis offset by the +0 's expansion radius, and the resulting display is the same as the border, but notice that the projection behaves differently from the border, and the projection doesn't affect the layout The "false" border is outside the element and does not affect the element's click (the Box-shadow attribute can be added to the inset element to project into the inner color).

1 <HTML>2 <Head>3     <MetaCharSet= "Utf-8">4     <title>Multiple borders</title>5     <styletype= "Text/css">6 Div{7 width:100px;8 Height:60px;9 margin:25px;Ten background:Yellowgreen; One  A Box-shadow:0 0 0 10px #665, - 0 0 0 15px deeppink, - 0 2px 5px 15px rgba (0,0,0,0.6); the     } -     </style> - </Head> - <Body> +     <Div></Div> - </Body> + </HTML>

Second, the outline programme

The Outline property lets you add a border to a border, rather than using Box-shadow, the advantage is that you can specify a different type for the border, not just a solid line; The disadvantage is that you can specify only two layers of borders.

1 <HTML>2 <Head>3     <MetaCharSet= "Utf-8">4     <title>Outline implementing a double border</title>5     <styletype= "Text/css">6 Div{7 width:100px;8 Height:60px;9 margin:25px;Ten background:Yellowgreen; One  A Border:10px Solid #665; - Outline:5px Solid Deeppink; -     } the     </style> - </Head> - <Body> -     <Div></Div> + </Body> - </HTML>

[CSS] "CSS Secrets" Learning (ii)-Multiple borders

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.