0

enter image description here

How does one create the triangle thing for a container that points to something? Is it photoshop?

bfavaretto
  • 71,580
  • 16
  • 111
  • 150
user773804
  • 143
  • 1
  • 10

2 Answers2

6

It can be done in pure CSS, but an image would be the more sane option.

HTML:

<div id="bubble">
    Yes we can
    <div id="arrow"></div>
    <div id="arrow-border"></div>
</div>

CSS:

#bubble {
    border:2px solid #036;
    font-size:20px;
    padding:10px;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    width:100px;
    position:relative;
}

#arrow {
    border-color: #036 transparent transparent transparent;
    border-style:solid;
    border-width:20px;
    height:0px;
    width:0px;
    position:absolute;
    bottom:-40px;
    left:20px;
}

#arrow-border {
    border-color: #fff transparent transparent transparent;
    border-style:solid;
    border-width:20px;
    height:0px;
    width:0px;
    position:absolute;
    bottom:-37px;
    left:20px;
}
grapefrukt
  • 27,016
  • 6
  • 49
  • 73
1

If you look here:

http://flowplayer.org/tools/demos/tooltip/index.html

The image that makes the tooltip thingy you're looking at is found here:

http://flowplayer.org/tools/img/tooltip/black_arrow.png

enter image description here

For a CANVAS (non-image) version, see jQuery's BeautyTips:

http://www.lullabot.com/files/bt/bt-latest/DEMO/index.html

CANVAS is like drawing to the screen. Don't ask me for an example, since I've never used it and I'm not real sure how it works. :P Note, browser support may be an issue with CANVAS.

Jared Farrish
  • 48,585
  • 17
  • 95
  • 104