HTML fixed position


#1

Hi I have a website where I would like to have a fixed position "discount" icon on the screen. so it's also displayed when scrolling. This, however, should only appear on him pc not tablets and phones. Is there someone who can help with this?


#2

You have two options here, using javascript to detect if you have mobile. Or use the media query to only show this when the screen has a minimum width of x px. I would pick 992px (bootstrap uses this value), add this:

<meta name="viewport" content="width=device-width, initial-scale=1">

some phones/tablet otherwise might cause you problems