Misc notes (mostly for myself):
Valid & good HTML & CSS:
- Remember the basic "official things"
- Right doctype for the HTML
- Validate HTML (for example with W3C HTML validator)
- Validate also CSS (W3C CSS Validator)
- Other important things
- Do not mix HTML & styles (no fonts etc)
- HTML is for structure & semantics, CSS is for the layout etc
- Maintainability : CSS class names preferably for content, not for the layout/presentation, for example:
- use "alert" instead of "red-highlight"
- use "news" instead of "left-side-bar"
Misc CSS/HTML notes:
- Block-level vs inline boxes
- Block-level (div, p, ...) : break before and after element
- Inline elements (strong, a, ...) : no break
Position
- absolute : one can define the position him/herself
- relative to its absolutely positioned parent (tag with absolute, relative or fixed positioning)
- in other words : positioned with respect to its containing block
- absolute positioned element is removed from the HTML flow, the space is freed
- relative : relative to elements "right place" at the HTML flow
- fixed : fixed position at the window
- static (the default) : element's box is generated as normal
No comments:
Post a Comment