This can be achieved through a little bit of css here.
The div will be there and we have to put an another div with its background set as the similar image which will create an illusion of the triange connected to the div itself. Again the triangle image will hide the existing border of the div at the point and display it like the triangle is connected to div.
The triangle image position should be set to a -ve value to go out of the
to a desired position.
First the css for the triangle should be look like below :-
You can edit it as per your need, it is written for adding atop triangle to main
background: url('write triangle image url here') 0 0 no-repeat;
Now here is the demo html for main and the inner div which can use this to display like triangle added at the top of main division :-
<div class="popup" style="top: 821px; left: 159.5px; display: block;">
<img src="some image url here" height="40" width="100" alt="Font Preview">
<a class="demoClass1" href="#">Demo</a>
<b>all products $29.00</b>
<a class="demoClass2" href="#">More</a>
The triangle image border design and the main div border design should match to make them look like single element only.
Please remember that this just for giving you the hint how this can be achieved and no guarantee that it will work as it is , just you need to modify it as per your need.
Hope this will be definitely show a light on your path.