background preloader

Css

Facebook Twitter

Equidistant Objects with CSS. Creating a horizontal row of objects that are equidistant from each other is another one of those things in web design that is much more difficult than it should be. This can be a very useful thing to do, especially in fluid width layouts when you are trying to make the most of whatever horizontal space you have. Here are the goals we are trying to achieve: The left-most object is left aligned with it's parent element.The right-most object is right aligned with it's parent element.Each object is equidistant from one another at all times.The objects will stop short of overlapping each other as the browser window narrows.The objects will not wrap down as the browser window narrows.The technique will work in a fluid width environment.

Even one that is centered. I tried a number of different techniques to try and achieve this. FAIL: Give each object a percentage left position First I gave each image a unique class: Then I gave percentage-based left positioning to each of those classes: Demo: Css - How to use text-overflow:ellipsis for 3 line truncate. jQuery 2d transform - JavaScript. With this jQuery transform plugin you will be able to: rotate any elementscale an element as well as its text contenttranslate elements in an efficient way*skew elements The elements can be transformed instantly or the transformation can be animated, using the standard jQuery css() and animate() functions: $('div.test').css( 'transform', 'rotate(10deg)' ); It is the lightest, cleanest and most efficient plugin to achieve 2d transformation in a cross-browser way. * no content reflow in modern browsers jquery.transform2d.js adds 2d transform capabilities to jQuery css() and animate() functions.

Set transform with a string You can use the following list of transform components: *matrix gives you more control about the resulting transformation, using a matrix construction set. Get transform returns a computed transform matrix. $('#myDiv').css('transform') == 'matrix(0,1,-1,0,100,50)'; Why such restrictions with 'translate'? Other plugins position the elements and wrap them transparently. CSS3 PIE: CSS3 decorations for IE. Guybedford/require-css. LESS « The Dynamic Stylesheet language.

CSS Tools: Reset CSS. The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. The general reasoning behind this was discussed in a May 2007 post, if you're interested. Reset styles quite often appear in CSS frameworks, and the original "meyerweb reset" found its way into Blueprint, among others. The reset styles given here are intentionally very generic. There isn't any default color or background set for the body element, for example. I don't particularly recommend that you just use this in its unaltered state in your own projects. In other words, this is a starting point, not a self-contained black box of no-touchiness. If you want to use my reset styles, then feel free! Previous Versions v1.0 (200802) Acknowledgments Thanks to Paul Chaplin for the blockquote / q rules.