Images
Correct Size Before Load
Just put correct natural width and height, even if CSS makes image fluid. So <img src="image.jpg" width="800" height="600">
Lazy Loading Image
Can use lib, usually use something like data-src with listeners
Image Types
Next gen formats, see next.js image loader for latest
Svg vs Png
Svg is great for infinite scaling with a relatively small file size, but the computer has to render the image from code
Pngs are ready to go and better for lower compute devices if you dont need infinitely scalable
SVG Graphics
XML language, style through CSS, images, scriptable(animatable)
Primatives
<svg>
rect
,circle
,line
,text
,polyline
all selfclosing except text i.e<line ... />
style
declarationsg
creates groupsxlink:href
copy instance
Example
Can then add classes and styles to the svg
Last updated