margin
is outside the borderpadding
is inside the borderfixed
is relative to viewport,absolute
is relative to position,relative
is to where it otherwise would be ... sighbottom
is positive up relative to container, whenposition==absolute
. Clobbers parent bottom-paddingborder-width
can offset DOM-nested items appearing like extra margin... To fix border outside of div, usebox-sizing:border-box
- The border of
body
can enclose nothing if first DOM-child isabsolute
overflow
works at parentwhite-space:nowrap
is as needed asoverflow:hidden
. Prevents drawing across border - but not padding ...
The special character ☰
aligns badly with text depending on font, which means it might be safer to use a bitmap?
Filling height to 100%
requires 100% all the way to <html>
- turtles all the way up? Also, excess commas in CSS cause things to not work but don't report errors only warnings, which are usually off in the console because of flooding FFF!
- Modules -> namespacing, Prototypes ("classes") -> closer to "normal" classes, but built like a dictionary with shared methods
- Modules - all initialisation executed on file load, so heavier on mobile first
- Modules - closure loops not garbage collected, again memory usage
- Prototype constructors -- use
new
keyword or elsethis
means global scope - http://www.samselikoff.com/blog/some-Javascript-constructor-patterns/
- https://www.stevefenton.co.uk/2013/12/javascript-prototype-vs-revealing-module-pattern/
- http://omarrr.com/javascript-module-pattern-a-detailed-deconstruction/
- Defining functions inside the constructor makes a new function object for every instance. Use carefully...
- Uses (potentially, much) more memory
- However this way also lets us gain private fields
- Module closurealso thwarts dynamic patching - good or bad depends
- requirejs - text.js - the browser wont load
text!
templates for security reasons