We develop an engine that serves ads to different mobile devices and websites. The ads are simply HTML markup with banners and/or some javascript. Sometimes we need to include a hidden pixel in the ad markup, to get a notification that the ad was actually displayed on end-user's device.
The pixel is basically a simple HTML image tag:
<img src="http://the-notification-url" />
The question is: what css should be used to: 1) hide the pixel on user device 2) make sure the pixel won't take any space and won't affect position of other HTML elements 3) be sure that ALL the browsers will actually try to download the pixel (i.e. trigger the 'src' URL)?
I can see two alternatives:
display:none;
or
visibility: hidden; position: absolute;
Are these alternatives the same in terms of the three goals we want to achieve? The most important goal is in fact the third one. Is it guaranteed that the img element having display:none or visibility:hidden will be always downloaded by all popular browsers (both windows/linux PCs and mobile devices ios/android)?