A pure CSS instance code that implements the tip effect of a bubble dialog box

Source: Internet
Author: User
This article mainly introduces the pure CSS implementation of the Bubble dialog box cusp processing implementation code, very good, with reference value, need to refer to the friend

Let's take a look:

Simple rough on the code:
Html:


<p class= "Dialog-box" >    <span class= "bot" ></span>    <span class= "Top" ></span>  </p>

Less

. dialog-box {    position:relative;    span {      width:0;       height:0;       font-size:0;       Overflow:hidden;       Position:absolute;      &.bot{        border-width:15px;         Border-style:solid dashed dashed;         Border-color:transparent transparent #F9743A transparent;         left:15px;         Top: -29px;      }      &.top{        border-width:13px;         Border-style:solid dashed dashed;         Border-color:transparent transparent #fff transparent;         left:17px;         top:-25px;}}}  

Plain English Explanation:

If you want the sharp corners of other orientations, adjust the order of the Boder-color (top, right, bottom, left).

The main principle is that there are two of the same shape, different proportions of the small triangle, a solid triangular bot with the same background, a white bottom of the top, and top will be covered in the bot above, and then adjust their size (generally, the solid is larger than the white block, so as to show a wink of the edge AH).

Finally, try to make them coincident (the top of the white top, the solid bot below), and finally by adjusting the absolute positioning parameters (Left,top) to make it coincident seamlessly. All right, I'm done, don't know if you got it yet?

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.