Having trouble displaying a speech bubble on my page. I created it using a div for the content and an image for the tail, both of which are hidden when the page loads. When a specific button is clicked, they are supposed to be displayed. However, only the content (#msg-loc) is showing up, not the image. I'm confused as to why this is happening. Oddly enough, if I remove the default hidden property, everything displays correctly. Does the display property not work with images? Any help would be appreciated. Thanks in advance for any advice. Cheers, Marc.
Here is my HTML:
<div id="msg-loc" class="hidden">
<img src="img/triangle.png" class="hidden triangle"/>
</div>
My JavaScript code:
$('#msg-loc').html('the value is incorrect').removeClass('hidden');
$('.triangle').removeClass('hidden');
And here is my CSS:
#msg-loc{
width:300px;
text-align:center;
margin-top:8px;
background-color:pink;}
.triangle{
left:65px;
top:-13px;
position:relative;}
.hidden{
display:none;}