Ive spent at least 3 hours trying to figure this out fully and I finally got it!!! Using this code (without the brackets) you can have a floating div 🔽
<div style>
 <div style="float: ;Â
max-height: 500px;Â
position: fixed;Â
right:[1, might depend on image size]px;Â
top: [depends on image sixe]px;Â
z-index: 600;"><img src="[image link]" width="[img w]" height="[img h]" loading="lazy">
</div>Â
Which is great and all but mobile users are out there!! It might cover their view. Using this next code you can make it desktop only!!🔽
<body>
  <div class="mobileHide">
    <style type="text/css">
  .mobileHide { display: inline;}
  /* Smartphone Portrait and Landscape */
  @media only screen
  and (min-device-width : 320px)
  and (max-device-width : 480px){ .mobileHide { display: none;}}
</style>
[div you want hidden here]
</body>
🔽Together they look like this!!🔽
<body>
  <div class="mobileHide">
    <style type="text/css">
  .mobileHide { display: inline;}
  /* Smartphone Portrait and Landscape */
  @media only screen
  and (min-device-width : 320px)
  and (max-device-width : 480px){ .mobileHide { display: none;}}
</style>
<div style>
 <div style="float: ;Â
max-height: 500px;Â
position: fixed;Â
right:[1, might depend on image size]px;Â
top: [depends on image sixe]px;Â
z-index: 600;"><img src="[image link]" width="[img w]" height="[img h]" loading="lazy">
</div>Â
</body>
My profile includes both of these codes so you can look at it for a visual if ya want!!
Comments
Displaying 1 of 1 comments ( View all | Add Comment )
LilSisPlanet
actual lifesaving code
Report Comment