Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speechbubble tooltip in CSS - how to move the arrow

Tags:

html

css

tooltip

Hey there i created this little speech bubble tooltip, where the arrow is at the bottom:

http://jsfiddle.net/QNPYQ/

.bubble:after {
    border-color: #EEEEEE rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
    border-style: solid;
    border-width: 26px;
    bottom: -52px;
    content: "";
    display: block;
    height: 0;
    left: 4em;
    position: absolute;
    width: 0;
}

Anybody could tell me how to make the arrow at the top of the <div>?

like image 651
user3297073 Avatar asked Dec 26 '22 12:12

user3297073


1 Answers

You could rotate the arrow and place it according to top

.bubble:after {
    border-color: #EEEEEE rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
    border-style: solid;
    border-width: 26px;
    top: -52px;
    content: "";
    display: block;
    height: 0;
    left: 4em;
    position: absolute;
    width: 0;
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    transform: rotate(180deg);
}

An example : http://jsfiddle.net/QNPYQ/1/

like image 159
Vangel Tzo Avatar answered Jan 14 '23 06:01

Vangel Tzo