HTML/CSS
Jump to navigation
Jump to search
to merge from bits of design. aaand break out.
Specs
- HTML Living Standard
- HTML: The Markup Language
- HTML5: Edition for Web Authors - omits UA aspects
- W3C: CSS (2010 snapshot)
- W3C Wiki: CSS
Docs, guides, etc.
Basics
- A Beginner’s Guide to HTML & CSS is a simple and comprehensive guide dedicated to helping beginners learn HTML and CSS. Outlining the fundamentals, this guide works through all common elements of front-end design and development.
- Mozilla Developer Network
- Introduction to The Web Standards Curriculum - opera
- Web Education Community Group Wiki - w3c
Resources
Articles
- About HTML semantics and front-end architecture
- HTML5 id/class name cheatsheet - Or, “The mapping of HTML5 structural elements to id and class names for use with s”
- Principles of writing consistent, idiomatic CSS
- Scalable and Modular Architecture for CSS - A flexible guide to developing sites small and large.
Tools
Chrome
Firefox
Bookmarklets
div { outline:1px solid red; }
- Holmes is stand-alone diagnostic CSS stylesheet that can highlight potentially invalid, inaccessible or erroneous HTML(5) markup by adding one class.
- http://speckyboy.com/2009/02/16/32-indispensable-bookmarklets-for-web-developers-and-designers/
- http://aymanh.com/css-debugging-bookmarklets - outline is border not outline >_<
- http://subtlegradient.com/articles/2009/07/23/subtle_hover_css_inspect_bookmarklet.html
Testing
Browsers available:
- Chromium 22 (Dev)
- Google Chrome 19
- Firefox 13
- Firefox 16 (Nightly)
- Opera 12
Plus Windows; Firefox, Chrome, IE.
To check
Resets, normalize, etc.
Different browsers have different defaults.
- http://stackoverflow.com/questions/6887336/what-is-the-different-between-normalize-css-and-reset-css
Selectors
- Selectors Level 3 - W3C Recommendation 29 September 2011
- http://twostepmedia.co.uk/cssselectors/
- http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/
h1 + h2 <h1></h1><h2></h2> h1 > h2 <h1><h2></h2></h1>
- root - Selects the element that is at the root of the document. Almost certainly will select the <html> element, unless you are specifically working in some weird environment that somehow also allows CSS. Perhaps XML.
- first-child - Selects the first element of its type within a parent.
- last-child - Selects the last element of its type within a parent.
- nth-child(N) - Selects elements based on a simple provided algebraic expression (e.g. "2n" or "4n-1"). Has the ability to do things like select even/odd elements, "every third", "the first five", and things like that. Covered in more detail here with a tester tool.
- nth-of-type(N) - Works like :nth-child, but used in places where the elements at the same level are of different types. Like if inside a div you had a number of paragraphs and a number of images. You wanted to select all the odd images. :nth-child won't work there, you'd use div img:nth-of-type(odd). Particularly useful when working with definition lists and their alternating -dt- and -dd- elements.
- first-of-type - Selects the first element of this type within any parent. So if you have two divs, each had within it a paragraph, image, paragraph, image. Then div img:first-of-type would select the first image inside the first div and the first image inside the second div.
- last-of-type - Same as above, only would select the last image inside the first div and the last image inside the second div.
- nth-last-of-type(N) - Works like :nth-of-type, but it counts up from the bottom instead of the top.
- nth-last-child(N) - Works like :nth-child, but it counts up from the bottom instead of the top.
- only-of-type - Selects only if the element is the only one of its kind within the current parent.
Specificity
p has a specificity of 1 (1 HTML) div p has a specificity of 2 (2 HTML; 1+1) .sith has a specificity of 10 (1 class) div p.sith has a specificity of 12 (2 HTML and a class; 1+1+10) #sith has a specificity of 100 (1 id) body #darkside .sith p has a specificity of 112 (HTML, id, class, HTML; 1+100+10+1)
Positioning
display: block - default 100% width, flows vertically display: inline - consumes width of content, flows horizontally display: inline-block display: table-cell - vertical align method [5] http://www.quirksmode.org/css/display.html float - floats element next to containing box or other floated element position: absolute - out of flow
- https://github.com/andreasbovens/understanding-viewport
- http://www.brainjar.com/css/positioning/default.asp
- http://blog.themeforest.net/tutorials/vertical-centering-with-css/ [6]
- http://css-tricks.com/what-is-vertical-align/
- http://www.barelyfitz.com/screencast/html-training/css/positioning/
Tips
Properties
Responsive
- Media Queries - W3C Recommendation 19 June 2012
- https://developer.mozilla.org/en/CSS/Media_queries/
- Multi-Device Layout Patterns
- Media Queries - Many great examples
- CSS: Elastic Videos
- Responsive Media
- FitVids: Which class selector to use with embed videos from youtube
- Media: YouTube - Responsive Embeds
- http://drupal.org/project/fitvids - js lib
Accessibility
See also Design
Headings should not be removed using display:none, because it removes the headings from assistive technology. Instead headings can be made invisible to sighted users using CSS class="element-invisible". [8]
Colour
rgba(0, 0, 0, 0.2) - shadow
Background
Outline
- http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines
- http://htmldog.com/reference/cssproperties/outline/
Animations & transitions
- http://www.w3.org/TR/css3-animations/
- https://developer.mozilla.org/en/CSS/CSS_animations
- http://www.jasondavies.com/animated-bezier/
- http://daneden.me/animate/
Grid
Frameworks
960.gs
blueprint
other
- http://grids.heroku.com/
- http://www.gridsystemgenerator.com/gs01.php
- http://gridpak.com/
- http://www.designbygrid.com/tools
- http://blog.centresource.com/2009/06/15/6-tips-and-tricks-for-designing-with-960/
- http://divitodesign.com/css/tricks-to-solve-960-css-framework-problems/
- http://hashgrid.com/ - js grid display
- http://gridwax.gs/ - grid bookmarklet
- http://peol.github.com/960gridder/ - grid and rhythm bookmarklet
Vertical rhythm
- The Elements of Typographic Style Applied to the Web
- http://24ways.org/2006/compose-to-a-vertical-rhythm - oft' linked to
Web
- http://www.gridlover.net/
- http://drewish.com/tools/vertical-rhythm - calculator, px based
- http://topfunky.com/baseline-rhythm-calculator/ - px based
- http://lamb.cc/typograph/ - Scale & Rhythm - fucking weird paddings
JS
Bookmarklets
- http://gridwax.gs/ - great
- http://sfcgeorge.github.com/Grid-Bookmarklet/
- http://scribu.net/util/baseline-checker-bookmarklet.html
CSS
Sass
- See Sass
Font symbols
Sprites
Menus
Gradients
Full screen
Misc
- http://davatron5000.github.com/deCSS3/ - bookmarklet to test pre css3 browsers
- http://www.youtube.com/watch?v=a2_6bGNZ7bA Faster HTML and CSS: Layout Engine Internals for Web Developers