Reputation: 1734
I'm wondering how to go about creating a div with an arrow attached to the bottom pointing downwards. I can achieve that effect like so: http://jsfiddle.net/hyH48/.
However, I'm not sure how to ensure that the arrow is in the centre of the div? In the fiddle, it is positioned using:
left: 20px;
But can I dynamically set this to appear in the centre? Obviously with people viewing the page on different screen resolutions I can't know in advance the integer to put here.
Please help?
Upvotes: 1
Views: 93
Reputation: 103
What you what to do is add left:50%;
and margin-left:20px;
to #mybox:after
. See http://jsfiddle.net/hyH48/1470/
Upvotes: 0