Chapter II Background & Borders Transparent Border

Source: Internet
Author: User

1.Translucent (Translucent) Border

The first example in chapter two is to implement a translucent border. The effect is as follows:

At first glance, it is very simple, boder is done, the code is as follows:

border:10px solid Hsla (0,0%,100%,.5);

Background:white;

But this does not work at all, the effect is border disappeared ....

Hey... What's the hell? Originally, border did not disappear at all, our background:white border to cover the-_-, so as long as a way to change the width of background to the box of the inner margin padding on the line

After removing the background:white, you can clearly see the box's border.

The Background property, by default, is overwritten to Border-box, and you want to modify it by Background-clip property (ie9+):

Background-clip:content-box|padding-box|content-box

It's a clang. So when we add background-clip:padding-box to the box, we get the effect we want.

Chapter II Background & Borders Transparent Border

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.