Bubble Prompt box developed by pure CSS-----------only need one class_css

Source: Internet
Author: User

In fact, the principle is very simple, that is, befor is a small triangle has a color

After is a small triangle has no color

Use after to cover befor can

Don't say much, just go to the code.

1. This is the triangle on top.

. Tipbox{display:block;position:absolute;bottom: -36px;right:0px; width:66px;border-radius:3px;line-height:28px; text-align:center;font-size:12px; Color: #999; height:28px;  border:1px solid #eee;  Background-color: #FFF;
Tipbox:before,. tipbox:after{    content: "";  Display:block;  border-width:8px;  Position:absolute;  bottom:29px;
    left:39px;
    Border-style:dashed dashed dashed dashed;
    Border-color:transparent transparent #eee transparent;
    font-size:0;
    line-height:0; }
. tipbox:after{    bottom:28px;
    Border-color:transparent transparent #FFF transparent;
}

2. The triangle is next to the

HTML structure is the same as before: 1 2 3 4 5 6 < div class= "tag" > < div class= "Arrow" > < em ></em >< span ></span > </div > CSS Bubble box implementation </div >

The rectangle CSS style changes slightly: 1. tag{width:300px; height:100px;  position:relative; Background-color: #09F;}

Reposition the triangle arrow: 1. arrow{Position:absolute;  width:70px;  height:60px;  Left: -70px; bottom:10px;}

The adjacent Border-style value of the element is set to solid (displayed), and the other side is set to transparent (not shown) 1. Arrow *{Display:block;  Position:absolute; Border-style:dashed solid solid dashed; font-size:0; line-height:0; }

First simulate a right triangle, the adjacent sides of an element of color set to the same value, the other two colors are set to transparent, you can get a right angle: 1. Arrow em{border-color:transparent #09F #09F transparent bo rder-width:30px 35px;}

By overlapping two triangles, you can get an irregular triangle. 1. Arrow span{border-width:20px 35px; border-color:transparent #FFF #FFF Transparent; bottom:0;}

At this point, the bubble box effect for the irregular triangular arrows has been implemented.



33 horns in the bottom.

<! DOCTYPE html>

The final effect is as follows:

 

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.