Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
glenn romaniuk
33,659 Pointshow they create caption pointers
I'm not sure what you call them but typically when the designers wants the context of a box to focus on some part of the page they add a pointer to it. Referring to the small triangle i see in this project. How do they create these effects?
Example:
https://teamtreehouse.com/library/jquery-basics/creating-a-simple-drawing-application/perform-part-1
Refer to the ponter on the colorSelect
2 Answers
Enzio Rossa
2,661 PointsHello,
Usually when I try to create this I use an :after statement.
For example you got a box.
<div id="box"></div>
#box {
width: 500px;
height: 500px;
background: #000;
position: relative; // don't forget :)
}
#box:after {
content: " ";
position: absolute;
background-color: #000;
background-size: 50px 50px; // apparently, :after needs an background-size, width and height
width: 50px;
height: 50px;
transform: rotate(45deg); // I advise you to use prefixes for this to. (-webkit-, -moz-, -ms-, etc)
display: block;
bottom: -25px;
margin-left: 50%;
left: -25px;
}
glenn romaniuk
33,659 Pointsthanks