Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Last active March 4, 2024 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unitycoder/bbf69568e0d325bda366df7c740d01eb to your computer and use it in GitHub Desktop.
Save unitycoder/bbf69568e0d325bda366df7c740d01eb to your computer and use it in GitHub Desktop.
HTML CSS Notes
// https://github.com/atherosai/ui/tree/main/layout-01
responsive grid layout
// blending mode css
https://hackernoon.com/a-css-property-that-every-web-designer-must-to-know-li6w36ca
// make website mobile friendly
- add viewport meta: (scale = 0 is no zoom)
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- test in chrome, better than firefox mobile preview
- test https://search.google.com/test/mobile-friendly
// make all divs scale with window and stay in position
<div id="container" style="position: relative;width:6vw;height:4vw;top:1vw;background:yellow">
<div id="innerdiv1" style="z-index: 1; position:absolute; width: 3vw;2vw;background:red;">a</div>
<div id="innerdiv2" style="z-index: 2; position:absolute; width: 4vw;height:2vw;background:blue;left:0.2vw;top:0.2vw;"></div>
</div>
// make image not draggable (no ghost image when drag)
<img src="maps/wow.jpg" draggable="false" />
@unitycoder
Copy link
Author

You can use the loading=lazy attribute to defer the loading of the image until the user scrolls to them.
https://markodenic.com/html-tips/

@unitycoder
Copy link
Author

@unitycoder
Copy link
Author

image with/as text overlay effect
https://codepen.io/denic/pen/mdXZgMG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment