I want to make my MOBILE web site the main one. So, I want to know what HTML
, CSS
or Javascript
code is necessary to detect a desktop PC ( like detecting the "hover" capability ) so that the mobile web site would send the user to a desktop web site version.
I already read this post: "How to detect whether the user is using mobile, tablet or desktop and redirect them?"
I want to use the CSS @media
function to detect a desktop PC or a laptop by using the hover
property. If one of these devices are detected then I wanted this function to make the browser leave this mobile web page and bring another web page (one built for desktop PC or laptop).
Here is a pseudo-code of what I want:
<style>
@media (hover: hover) // detects desktop PC or laptop
{
redirect to ( “https://desktop_web_site.html”);
}
…
</style>
or a Javascript code that does the same.