background preloader

CSS

Facebook Twitter

Stroll.js - CSS3 Scroll Effects. Edit this Fiddle. Create Banner Using CSS Animation & Keyframe. A collection of best front-end frameworks with comparison | By usabli.ca. Sass - Syntactically Awesome Stylesheets. CSS Buttons Generator for your pleasure. Powerful New CSS- and JavaScript-Techniques (2012 Edition)

Advertisement Since our last round-up of useful CSS techniques1, we’ve seen a lot of truly remarkable CSS geekery out there. With CSS3, some of the older techniques now have become obsolete, others have established themselves as standards, and many techniques are still in the “crazy experimentation” stage. Since the release of the previous post, we’ve been collecting, sorting, filtering and preparing a compact overview of powerful new CSS techniques.

Today we finally present some of these techniques. Please note that many techniques are not only CSS-based, but also use HTML5 and JavaScript. Table of Contents CSS Transitions And Animations CSS transitions and animations are often used to make the user experience a bit more smooth and interesting, especially when it comes to interactive effects on hover or on click. CSS3 dodecahedron9 A fancy dodecahedron experiment, created using CSS Transforms and a tiny JavaScript snippet. Beercamp: An Experiment With CSS 3D21 A CSS 3D popup book á la Dr. Keep your CSS selectors short. 15 May, 2012 One thing I believe, as a very, very general rule of thumb, is that as sites get bigger, selectors should get shorter. By this I mean that if you want to create extensible and maintainable, flexible and predictable websites, you should really take care to make your CSS selectors as dev-friendly as possible; i.e. short.

Keeping CSS selectors short helps with a lot of things: Increases selector efficiencyReduces location dependencyIncreases portabilityReduces chances of selector breakageDecreases specificityCan make code more forgiving This is a very vague list, so I’m going to address each in order. Increases selector efficiency I have written before about CSS selector efficiency. If we ignore actual types of selector (*{} is typically the slowest, depending on how it’s being used, IDs are the fastest followed by classes, descendants are comparably quite slow followed by pseudo-selectors) then in general it is safe to say that shorter selectors are faster. Increases portability. Blog Archive » Cross-Browser Debugging CSS. I was helping Laura (a developer who works with me) learn about cross-browser debugging this week, which got me excited to share my process. The first principal is simply: Work with CSS, not against it. CSS has an underlying design and when you work with it, with the natural flow of how CSS is meant to be used, you will find you have a lot less bugs.

I learned CSS by reading the W3C specifications, which is why I began coding according to the language’s design, but however you learned it, you can pick up some of the key points involved. The first thing I do is code to a good browser from the start. Our choice is Google Chrome, mainly because of the superior developer tools. If there is a discrepancy between these good browsers, chances are you are working against CSS. HTML interpretation – did you forget to close a tag? If you don’t read anything else, read the next two paragraphs The most important thing to keep in mind is that error behavior is not defined in the spec. Display Positioning. LESS « The Dynamic Stylesheet language. Splash and Coming Soon Page Effects with CSS3. CSS3 opens up so many crazy possibilities and today we want to show you how to go wild with splash and coming soon page effects using CSS3 animations.

We'll experiment with animation sequences and how to bring some life to some simple elements. View demo Download source CSS3 opens up so many crazy possibilities and today we want to show you how to go wild with splash and coming soon page effects using CSS3 animations. We’ll experiment with animation sequences and how to bring some life to some simple elements. The cute shoe photos that we are using in the first demo are by lovely Amira Almajid and you can find the set here. Please note that the animations will only work in modern browsers that support them.

In order not to bloat the tutorial, I’ve omitted the CSS vendor prefixes but you’ll find them in the downloadable files. Example 1 Please note, that I added a longer delay for this example to give some time to load the images. The Markup Ok, now the exciting part: the CSS! The CSS Example 2. CSSTidy. CSS Sprite Generator | Project Fondue.

CSS Decorative Gallery (adding frames and overlays to images using CSS and transparent PNGs/GIFs) Did you like my previous CSS tutorial on how to create gradient text effects? I'm using the same trick to show you how to decorate your images and photo galleries without editing the source images. The trick is very simple. All you need is an extra <span> tag and apply a background image to create the overlaying effect.

It is very easy and flexible — see my demos with over 20 styles, from a simple image icon to a rounded corner to a masked layer (both decorative and complex). View Demo Gallery Download Demo ZIP What Are The Benefits Of This CSS Trick? Saves Time — You don't have to manually create the decorative template in Photoshop and export the individual image. Basic Concept (see demo) You need to insert an extra <span> tag within the <div> tag, with which we'll apply a background image to create the overlaying effect. Then in the CSS, the key point you have to remember is: specify the div element to position:relative and the span element to position:absolute.

IE PNG Hack Look and Feel. Perfect Full Page Background Image. Learn Development at Frontend Masters This post was originally published on August 21, 2009 and is now updated as it has been entirely revised. Both original methods are removed and now replaced by four new methods. The goal here is a background image on a website that covers the entire browser window at all times. Let’s put some specifics on it: Fills entire page with image, no white spaceScales image as neededRetains image proportions (aspect ratio)Image is centered on pageDoes not cause scrollbarsAs cross-browser compatible as possibleIsn’t some fancy shenanigans like Flash Image above credited to this site.

Awesome, Easy, Progressive CSS3 Way We can do this purely through CSS thanks to the background-size property now in CSS3. Works in: Safari 3+Chrome Whatever+IE 9+Opera 10+ (Opera 9.5 supported background-size but not the keywords)Firefox 3.6+ (Firefox 4 supports non-vendor prefixed version) View Demo CSS-Only Technique #1 Big thanks, as usual, to Doug Neiner for this alternate version. The 1KB CSS Grid by Tyler Tate :: A simple, lightweight approach. Video Screencasts. #130: First Moments with Grunt There are all these tasks that we need to do as front end developers. Concatenate and compress our files. Run our preprocessors. Optimize images. . #127: Basics of JavaScript Templating A template is a chunk of HTML that you need to inject onto the page. . #126: Using Modernizr Should Modernizr be part of every modern web project? #124: A Modern Web Designer’s Workflow This is a presentation I gave at conferences in late 2012 and early 2013.

It talks … #121: The Right CMS is a Customized One The perfect CMS to suite the needs of any non-trivial content-oriented website does not come out-of-the-box. . #119: Let’s Answer Forum Posts! In this screencast we live answer more forums posts with no planning whatsoever. . #117: Let’s Attempt To Do a “Pull Request” I’ve never in my life submitted a “Pull Request” on GitHub. . #115: Don’t Overthink It Grids Even if the layout of a site is simple as a main content area on the left and a sidebar on the right, that’s a grid. Less Framework 4. I called Less Framework "a CSS grid system for designing adaptive websites".

It was basically a fixed-width grid that adapted to a couple of then popular screen widths by shedding some of its columns. It also had matching typographic presets to go with it, built with a modular scale based on the golden ratio. The resources it was originally published with are still available on GitHub. Contrary to how most CSS frameworks work, Less Framework simply provided a set of code comments and visual templates, instead of having predefined classes to control the layout with. /* Default Layout: 992px. Less Framework was popular in the early days of responsive design. Eventually, I moved on from fixed-width grid systems and worked on a fully fluid-width one, in the form of Golden Grid System.

Less Framework's popularity was helped by the following contributions and the lovely people behind them (dead links crossed off): HOW TO: Get Started with Less Framework. The Web Development Series is supported by Rackspace, the better way to do hosting. Learn more about Rackspace's hosting solutions here. For the past few years, CSS grid systems have become increasingly popular with web designers. Thanks to efforts like Nathan Smith's 960.gs, designing with a grid is less complicated, and better looking sites can be crafted with ease. One of my favorite CSS grid systems of late is Less Framework. Now in its fourth revision, Less Framework takes the power of a CSS grid system and adds in support for CSS media queries to support multiple design and typography layouts. In May 2010, Ethan Marcotte's "Responsive Web Design" helped spur a movement of building websites designed to fluidly adapt to various platforms and device sizes — think mobile optimized sites and tablet-specific layouts — without the need for an entirely different design or special URL.

Knowing the Basics Visit LessFramework.com and resize your browser to see the implementation in action. Formalize CSS - Teach your forms some manners! Learn CSS Positioning in Ten Steps: position static relative absolute float. 1. position:static The default positioning for all elements is position:static, which means the element is not positioned and occurs where it normally would in the document. Normally you wouldn't specify this unless you needed to override a positioning that had been previously set. 2. position:relative If you specify position:relative, then you can use top or bottom, and left or right to move the element relative to where it would normally occur in the document. Let's move div-1 down 20 pixels, and to the left 40 pixels: Notice the space where div-1 normally would have been if we had not moved it: now it is an empty space.

It appears that position:relative is not very useful, but it will perform an important task later in this tutorial. 3. position:absolute When you specify position:absolute, the element is removed from the document and placed exactly where you tell it to go. Let's move div-1a to the top right of the page: What I really want is to position div-1a relative to div-1. Footnotes 10. One list, many options - Using CSS and a simple list to create radically different list options. CSS for Accessibility. W3C Note 6 November 2000 This version: (plain text, PostScript, PDF, gzip tar file of HTML, zip archive of HTML) Latest version: Previous version: Editors: Wendy Chisholm, W3C; Gregg Vanderheiden, Trace R & D Center, University of Wisconsin -- Madison; Ian Jacobs, W3C Copyright ©1999 - 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved.

Abstract This document describes techniques for authoring accessible Cascading Style Sheets (CSS). This document is part of a series of documents about techniques for authoring accessible Web content. Note: This document contains a number of examples that illustrate accessible solutions in CSS but also deprecated examples that illustrate what content developers should not do. Status of this document This version has been published to correct some broken links in the previous version. 2 User override of styles.

CSS Gradient Text Effect. Do you want to create fancy headings without rendering each heading with Photoshop? Here is a simple CSS trick to show you how to create gradient text effect with a PNG image (pure CSS, no Javascript or Flash). All you need is an empty <span> tag in the heading and apply the background image overlay using the CSS position:absolute property. This trick has been tested on most browsers: Firefox, Safari, Opera, and even Internet Explorer 6. Continue to read this article to find out how. View Demos Download Demo ZIP Benefits This is pure CSS trick, no Javascript or Flash. How does this work?

The trick is very simple. The HTML markups <h1><span></span>CSS Gradient Text</h1> The CSS That's it! Make it work on IE6 Since IE6 doesn't render PNG-24 properly, the following hack is required in order to display the transparent PNG (add anywhere in between the <head> tag): This is why we hate IE 6! jQuery prepend version (for semantic lovers) More samples Want to make Web 2.0 glossy text? Pattern / Texture. Math in HTML (and CSS) - presenting mathematical expressions on Web pages. Typesetting math: 100% How to present math­emat­ical ex­pres­sions using a language that has so little markup for them? Web authors often need resort to images, but there are more flexible approaches, like MathJax. Moreover, if you need just some special symbols or simple ex­pressions, a lot can be done in HTML, assisted with style sheets (CSS).

This document mainly discusses relatively simple mathematical expressions rendered one-dimensionally (inline), though possibly with superscripts or subscripts. The word “mathematical” is used in a rather broad sense here, covering different for­mal­isms and symbols, including the symbols of physics, formal logic, etc. You might wish to take a look at Andreas Prilop’s nice document Mathematical formulas in HTML 4.0, which illustrates well what kinds of symbols and expressions are discussed here. What? You may have wondered why web sites, such as Wikipedia, use images for presenting mathematical formulas, even in simple cases like ∇²φ = 0. Css.maxdesign.com.au - CSS resources and tutorials for web designers and web developers.

Step by step CSS float tutorial. Floatutorial takes you through the basics of floating elements such as images, drop caps, next and back buttons, image galleries, inline lists and multi-column layouts. General info Tutorial 1. Floating an image to the right Float an image to the right of a block of text and apply a border to the image. Tutorial 2. Floating an image and caption Float an image and caption to the right of a block of text and apply borders using Descendant Selectors. Tutorial 3. Float a series of images down the right side of the page, with content flowing beside them. Tutorial 4. Float a series of thumbnail images and captions to achieve an image gallery. Tutorial 5. Float a simple list into rollover "back" and next "buttons".

Tutorial 6. Float a simple list, converting it into a horizontal navigation bar. Tutorial 7. Float a scaleable drop cap to the left, resize it and adjust line-heights to suit your needs. Tutorial 8. Float a left nav to achieve a two column layout with header and footer. Tutorial 9.