Reputation: 109
The top example specifically:
To be precise, I'd like to use a <p>
instead of a background image.
Upvotes: 1
Views: 118
Reputation: 4888
It is possible. Generally, you have to place your text inside #reveal
and offset it by the same number of pixels that #reveal
is moved, but negative.
Demo.
Upvotes: 3
Reputation: 1202
You can use a square white image with a transparent circle in the middle and just position it around, and then have different elements with white background mask the rest of the image.
<div>
<img src="http://example.com/img.png"/>
<div id="masking-circle"></div>
<div id="mask-top"></div>
<div id="mask-bottom"></div>
<div id="mask-left"></div>
<div id="mask-right"></div>
</div>
Upvotes: 0
Reputation: 4565
It's a game of z-index values http://www.w3schools.com/cssref/pr_pos_z-index.asp and a mousemove listener
Upvotes: -2