Implement QQ chat bubbles and QQ chat bubbles

Source: Internet
Author: User

Implement QQ chat bubbles and QQ chat bubbles
Today, I used HTML/CSS to create a chat bubble similar to QQ. below is:
Next, let's talk about the style settings in the key areas, and then paste the html and css Code (not much ).

Step 1: Layout
The message layout is div + float. Each message is enclosed by a DIV label, and two divs are placed in it to enclose the user icon and user message content respectively. The message on the left is cleared first, and then float: left is set so that the user icon and message content can be displayed in the same line. The user icon is on the left and the message content is next to the user icon.
The message on the right is cleared first, and then float: right is set. The user icon and message are displayed in the same line. The icon is on the rightmost and the message is displayed on the left.

Step 2: Set the rounded rectangle

border-radius:7px;     

Step 3: triangle arrow
Set the width and height of the DIV to 0 and the Border width to show a rectangle composed of four triangles, you can set the color and size of each triangle by setting the border Width and color.
Set the color of the three triangles to transparent, leaving only one triangle visible.

    .triangle{        width: 0px;        height: 0px;        border-width: 15px;        border-style: solid;        border-color: red blue green gold;    }

    .triangle{        width: 0px;        height: 0px;        border-width: 15px;        border-style: solid;        border-color: transparent transparent transparent red;    }

Key Aspect 4: triangle rectangular frame
By using relative positioning, the triangle can always be fixed on the side of the rectangle frame.
position:relative;

All code:












How to change the QQ chat box into a bubble

No! It should be said that it cannot be implemented for the time being! The question is absolutely no such thing as Shenma. I have searched for it many times. I have seen it in various QQ versions and other chat software.

Why is QQ chat a bubble?

Because of the update, you can view the text with colorful bubbles in the dialog box. If you want to cancel the text, click the box above to remove the hook.

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.