HTML/CSS
to merge from bits of design. aaand break out. and generally sort.
Standards
- W3C Standards for the Open Web Platform
HTML
- HTML Living Standard
- HTML: The Markup Language
- HTML5: Edition for Web Authors - omits UA aspects
- HTML5: Editor's Draft - bleeding edge
CSS
- W3C: CSS (2010 snapshot)
Working Drafts
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.
- Dive Into HTML5 by Mark Pilgrim
- http://stac.ly/cheat/
- 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 divs”
- Principles of writing consistent, idiomatic CSS
- Scalable and Modular Architecture for CSS - A flexible guide to developing sites small and large.
- http://blog.responsivenews.co.uk/post/18948466399/cutting-the-mustard
Tools
See also Browsers
Bookmarklets
Overlay
div { outline:1px solid red; }
- http://aymanh.com/css-debugging-bookmarklets - outline is border not outline >_<
javascript:(function(){var t=['div','table','form','address','blockquote','h1','h2','h3','h4','h5','h6','p','pre','dd','dl','dt','ol','ul'];var c=['blue','blue','blue','red','red','red','red','red','red','red','red','red','red','green','green','green','green','green'];for (var i in t){var l=document.getElementsByTagName(t[i]);var j=0,e;while(e=l.item(j++)){e.style.outline='solid '+c[i]+' 1px';}}})();
Testing
- Holmes is stand-alone diagnostic CSS stylesheet that can highlight potentially invalid, inaccessible or erroneous HTML(5) markup by adding one class.
- Helps by showing errors
Testing
Browsers available:
- Chromium 22 (Dev)
- Google Chrome 20
- 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
Properties
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
Mobile & Responsive
Basics
- Responsive Web Design - A List Apart, MAY 25, 2010
- Responsive Web Design: Layouts and Media Queries - difference between basic fluid, adaptive and responsive layout, April 23rd, 2012
- Mobile First - Luke Wroblewski, Nov 3 2009
- How to make your CSS *really* mobile-friendly - 12.10.2010
- “The absence of support for @media queries is in fact the first @media query”
- Optimizing content for different browsers: the RIGHT way - w3c wiki
- CSS Media Query for Mobile is Fool’s Gold - August 3, 2010
to review;
- Effective Design for Multiple Screen Sizes - effective design strategies to target a diverse range of mobile devices and screen sizes. to review
- Design Process in the Responsive Age - A UX perspective
- Supporting high-dpi pixel-dense "Retina" Displays like iPhones or the iPad 3 with CSS or IMG
- A non-responsive approach to building cross-device webapps
Examples
- Responsive Design, Responsively Illustrated
- Multi-Device Layout Patterns
- Media Queries - Many great examples
Viewport
- Safari Developer Library: Configuring the Viewport
- MDN: Using the viewport meta tag to control layout on mobile browsers
- tuts+: Quick Tip: Don’t Forget the Viewport Meta Tag
- device-width and how not to hate your users - January 24, 2011
High DPI
Media Types/Queries
- CSS 2: Media types
- Recognized media types
- e.g., all, screen, print, projection, etc.
- https://developer.mozilla.org/en/CSS/@media
- Recognized media types
- CSS 3: Media Queries - W3C Recommendation 19 June 2012
- MDN: CSS media queries
@media <media type (expressions)> { /* media-specific rules */ } @media screen and (min-width: 500px) and (max-width: 800px) { ... }
or
<link rel="stylesheet" media="<media type (expressions)>" href="specific.css" />
- Simple responsive design test page - html file and bookmarklet iframe based viewport size simulation
- device.js - a starting point for doing semantic, media query-based device detection without needing special server-side configuration, saving the time and effort required to do user agent string parsing.
Articles
- CSS3 Media Queries - web designer wall , Aug 18, 2010
- CSS Media Queries & Using Available Space - css tricks, Jul 6 2010
- How To Use CSS3 Media Queries To Create a Mobile Version of Your Website - July 19th, 2010
- The EMs have it: Proportional Media Queries FTW! - March 28, 2012
- CSS3 Animated Media Queries - April 2012
320 and Up
- 320 and Up - The ‘tiny screen first’ responsive boilerplate
@media only screen and (min-width: 480px) { /* 480 =================================================== */ } @media only screen and (min-width: 600px) { /* 600 =================================================== */ } @media only screen and (min-width: 768px) { /* 768 =================================================== */ } @media only screen and (min-width: 992px) { /* 992 =================================================== */ } @media only screen and (min-width: 1382px) { /* 1382 =================================================== */ body { max-width: 1440px; } }
Other
- http://www.stuffandnonsense.co.uk/blog/about/hardboiled_css3_media_queries/ - deprecated method
- http://internet-alacarte.com/media-queries-template-for-browser-window-adjustments/ - basic example
- http://nmsdvid.com/snippets/
- http://www.getskeleton.com/
- responsive navigation patterns - Feb 24 2012
- Responsive Multi Level Navigation - June 19, 2012
Shim
- css3-mediaqueries.js by Wouter van der Graaf is a JavaScript library to make IE 5+, Firefox 1+ and Safari 2 transparently parse, test and apply CSS3 Media Queries. Firefox 3.5+, Opera 7+, Safari 3+ and Chrome already offer native support.
Video
- 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
Grid
Basics
- The Grid System
- Design By Grid is a resource to promote websites designed with grids, and the tools and techniques used to make websites with grids.
- Designing With Grid-Based Approach - Smashing Magazine, April 14th 2007
- The Secret Law of Page Harmony - 13th of July, 2010
- -http://www.teehanlax.com/blog/designing-faster-with-a-baseline-grid/ Designing Faster with a Baseline Grid] - March 9, 2011
Layout sizings
Quick resolution to grid width and layout list, wip;
- 240 x 320 (mobile)
- 3 60px columns, 20px gutter (960)
- 320 x 480 (mobile)
- 4 60px columns, 20px gutter (960)
- 480 x 640 (small tablet)
- 6 60px columns, 20px gutter (960)
- 768 x 1024 (tablet - portrait)
- 1024 x 768 (tablet - landscape)
- 960s has no far-left/right gutter, but there is space here
- 12 60px column, 20px gutter
- 16 40px column, 20px gutter
- 972 width
- 12 54px column, 30px gutter
- 960s has no far-left/right gutter, but there is space here
- 1200 x 800 (desktop)
Sizes from the Responsive Design Testing bookmarklet. See also http://978.gs/browsers/
Frameworks, etc.
- 960.gs
- Demo
- 12 60px column, 20px gutter
- 16 40px column, 20px gutter
- no far-left/right gutter
- Using the 960 Grid System as a Design Framework - Feb 10th 2011
- Demo
- Blueprint
- http://compass-style.org/reference/blueprint/grid/
- 12, 16, plus 24 30pxcolumn, 10px gutter
- 950px
- The Semantic Grid System
- The Semantic Grid System: Page Layout For Tomorrow
- Set column and gutter widths, choose the number of columns, and switch between pixels and percentages.
- less.js, sass, stylus
- Blankwork is a simple, flexible and semantic grid system.
- scss, flexible and semantic
- The Golden Grid
- 960gs with golden ratio vertical rhythm
fluid;
- Fluid 960 Grid System
- https://github.com/bauhouse/fluid960gs - couple of years ago
- Frameless - Adapt column by column, not pixel by pixel.
- adapts around 320, 480, 600, 900 and 1900 pixels
- less, scss, grid overlay
- Golden Grid System - A folding grid for responsive design.
- https://github.com/jonikorpi/Golden-Grid-System - few of months ago
- 240 up
- 18 even columns, two for grid border, 16 columns for design
- The Columnal CSS grid system
- responsive
- fluid
- 12 columns, dividing into two, three, four, or six columns.
- The Fluid Baseline Grid System system was built with typographic standards in mind and combines principals of fluid-column layouts, baseline grids and mobile-first responsive design into a resolution independent and device agnostic framework. It is packed with CSS normalization, beautiful typographic standards, corrected bugs, common browser inconsistencies and improved usability.
- Griddle is a fluid and modular grid system for modern browsers — IE8+, Firefox, Safari, Opera, Chrome.
Generators
- http://grids.heroku.com/
- http://www.gridsystemgenerator.com/gs01.php
- http://gridpak.com/
- http://www.designbygrid.com/tools
- http://modulargrid.org
- 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/
Overlays
- http://hashgrid.com/ - js grid display
- http://gridwax.gs/ - grid bookmarklet
- http://peol.github.com/960gridder/ - grid and rhythm bookmarklet
- https://github.com/milkmiruku/960gridder - my fork of the above. 16 column, 24 line height.
Vertical rhythm
- The Elements of Typographic Style Applied to the Web
- Compose to a Vertical Rhythm- oft' linked to, Dec 12th 2006
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
Typography
- http://www.w3.org/TR/css3-fonts/
- http://www.html5rocks.com/en/tutorials/webfonts/quick/
- http://ie.microsoft.com/testdrive/graphics/opentype/opentype-fontbureau/index.html
- The history of a model for fonts on the Web - w3c talk
- http://www.fontsquirrel.com/fontface/generator - service for converting to webfonts
- check compatability/shims
- http://people.mozilla.com/~jkew/woff/ - sfnt2woff, convert existing TrueType/OpenType fonts to WOFF format
- FontForge - An outline font editor that lets you create your own postscript, truetype, opentype, cid-keyed, multi-master, cff, svg and bitmap (bdf, FON, NFNT) fonts, or edit existing ones. Also lets you convert one format to another.
- https://github.com/thefella/Responsive-type-references
- http://informationarchitects.net/blog/responsive-typography-the-basics/
- http://trentwalton.com/2012/06/19/fluid-type/
Basics
font-size: 62.5% - set 1em equal to 10px
body article h1 h2 h3 p, ul small, aside
Kerning
- http://www.w3.org/TR/css3-fonts/#font-kerning-prop
- http://adamdscott.com/typography/kerning-for-the-web/
- http://adamdscott.com/typography/kerning-for-the-web/
- http://designshack.net/articles/typography/kerning-live-web-type-with-jquery-and-lettering-js/
- http://blog.typekit.com/2011/06/03/type-study-a-better-kerning-experience-with-kern-js/
- http://logofontandlettering.com/kernking.html - kerning ipsum
Font symbols
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". [10]
Background
- http://www.tizag.com/cssT/background.php/
- http://whereswalden.com/files/mozilla/background-size/more-examples.html
- http://css-tricks.com/perfect-full-page-background-image/
- http://www.vanseodesign.com/css/background-properties/ - w/ css3
Outline
- http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines
- http://htmldog.com/reference/cssproperties/outline/
Data
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/
Sprites
- http://jsfiddle.net/6PSVU/ - bottom: 0;
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
JS Shims
For fixing the lack of HTML5/CSS3 support in older browsers.
- http://www.useragentman.com/blog/csssandpaper-a-css3-javascript-library/
- http://ecsstender.org/
- http://selectivizr.com/