Detecting Retina Display with Javascript and CSS 2017


I recently worked on a project that requires detection of retina display or retina support. We needed the detection in a JavaScript file and a CSS style sheet. After googling for a while, we ended up using the following codes.

This post is actually a note to myself should incase a need for this arises again in future.

 

 

For CSS, use any of the below.

 

 

 

 

 

ads here