Posts tagged css

Thursday, September 6th

Stick your landings! position: sticky lands in WebKit

HTML5Rocks:

position: sticky is a new way to position elements and is conceptually similar to position: fixed. The difference is that an element with position: sticky behaves like position: relative within its parent, until a given offset threshold is met in the viewport.

Great, native replacement for a simple scroll hack. Until this becomes an adopted standard, you may want to check out the Affix plugin in Twitter Bootstrap.

Saturday, May 5th

Wednesday, May 2nd

CSS layout gets smarter with calc()

Didn’t even know about this feature, but it’s brilliant. A quick idea of what you can do:

#bar {
  height: calc(10em + 3px); 
}

And regarding current support:

The calc() property for lengths is available now in Chrome 19 (Dev channel build) by use of the ’-webkit-calc’ property, in Firefox since version 8 using the ’-moz-calc’ property and in Internet Explorer since version 9 unprefixed.

Wednesday, February 29th

Monday, February 20th

Friday, February 17th