This article is the official HTML5 training course of h5edu agency, Main introduction: CSS Basic Tutorial--The Bubble-type prompt box of pure CSS development
As a front-end developer, we are familiar with the use of CSS to generate rich on the page style, for the border border property, is also our most familiar CSS properties, today we will introduce how to use pure CSS to generate a bubble style balloon, I hope you like!
In this article we will use the following pseudo-label to generate the indicator arrows for the cue box.
First we define the relevant properties of the cue box, we add the box shadow and the text shadow effect, which makes the cue box more beautiful:
/* Bubble */
. tip-bubble {
position:relative;
width:100px;
padding:20px;
Color: #CCC;
Text-align:center;
border-radius:10px;
margin:50px;
border:1px solid #111;
box-shadow:1px 1px 2px #202020;
-moz-box-shadow:1px 1px 2px #202020;
-webkit-border-shadow:1px 1px 2px #202020;
text-shadow:0px 0px 15px #fff;
Copy the Code
Next we deal with: after pseudo tag:
. tip-bubble:after {
Content: ";
Position:absolute;
width:0;
height:0;
BORDER:15PX solid;
Copy the Code
Finally we define the arrow direction of the Cue box:
. tip-bubble-top:after {
Border-bottom-color: #202020;
left:50%;
bottom:100%;
Margin-left: -15px;
}
Click to enter CSS Basics Tutorial: http://www.h5edu.cn/htm/step/h5edu_133.html
CSS Basics Tutorial--bubble balloon for pure CSS development