I'm trying to make something like this:
I'd like to use pure CSS. Bootstrap v3 is already loaded.
I've gotten pretty close with something like
.bubble {
position:relative;
left: 15px;
padding: 10px;
background: #FFFFCC;
margin: 5px 5px;
max-width: 250px;
border: #FFCC00 solid 1px;
}
.bubble:before {
position:absolute;
content: "";
top:15px;left:-10px;
border-width: 10px 15px 10px 0px;
border-color: transparent #FFFFCC;
border-style: solid;
}
But the result is not quite what I'm looking for.
I've searched around and fiddled a bit, but have not found an elegant solution that fits my needs.
Years ago I would have done this with tables and images, but surely there's a better way in 2015?
Here is a 2015 version...
SEE IT IN ACTION:
http://jsfiddle.net/ajahb5p1/
NOTE:
You can adjust the size of the arrow simply by changing the
border-width
andmargin-top
values in the.bubble:after
definition (currently set to 15px and -15px)To make sure it retains it's border, you would also need to change these same 2 values in the
.bubble:before
definition (currently set to 16px and -16px)