Today we're going to share a custom border application based on pure CSS3, which looks like a ToolTip control because the bottom border has a small triangle, just like a reference text box in many places. In addition, the CSS3 border is graffiti-style and looks very personal. The advantage of implementing a custom border with CSS3 is that you can adapt the amount of text inside the border.
You can also view the online demo here
Let's share the implementation approach, which consists primarily of HTML code and CSS code.
HTML code:
<div>
<div>
<div>css3 Simple to implement graffiti style border Welcome to</div>
</div>
</div >
HTML code structure is very simple, only 3 div composition, of course, behind the CSS code is the key, we step-by-step to explain.
CSS Code:
. Wrap {
padding:35px 25px;
width:450px;
margin:40px Auto;
Background: #586786;
border-radius:255px 15px 225px 15px/15px 225px 15px 255px;
Color: #eee;
box-shadow:1px 1px 0px rgba (0, 0, 0,.)
}
This CSS code defines the outermost border, using Border-radius to achieve the rounded corners of the border, while taking advantage of the Box-shadow to implement a slightly shaded effect, it is not obvious that you can also fix a property value to make the shadow a little more obvious.
. box {
position:relative;
Background: #fff;
Border:solid 5px #fff;
width:200px;
height:100px;
margin:0 Auto;
border-radius:255px 15px 225px 15px/15px 225px 15px 255px;
padding:10px;
Color: #666;
box-shadow:2px 3px 1px rgba (0, 0, 0,. 75)
}
. box:before {
Content: "";
Position:absolute;
Bottom: -20px;
left:60px;
border:0;
border-right-width:30px;
border-bottom-width:20px;
Border-style:solid;
Border-color:transparent #fff;
Display:block;
width:0;
}