background preloader

Ten CSS tricks you may not know

1. CSS font shorthand rule When styling fonts with CSS you may be doing this: font-weight: bold; font-style: italic; font-variant: small-caps; font-size: 1em; line-height: 1.5em; font-family: verdana,sans-serif There's no need though as you can use this CSS shorthand property: font: bold italic small-caps 1em/1.5em verdana,sans-serif Much better! 2. Usually attributes are assigned just one class, but this doesn't mean that that's all you're allowed. <p class="text side">... Using these two classes together (separated by a space, not with a comma) means that the paragraph calls up the rules assigned to both text and side. 3. When writing a border rule you'll usually specify the color, width and style (in any order). If you were to write just border: solid then the defaults for that border will be used. 4. Lots of web pages have a link to a print-friendly version. So, your page header should contains links to two CSS documents, one for the screen, and one for printing: 5. <h1>Buy widgets</h1>

http://www.webcredible.co.uk/user-friendly-resources/css/css-tricks.shtml

CSS Crib Sheet You will no doubt come across many quirky layout issues when building a site with CSS. You'll end up banging your head against a wall time and again. This is an attempt to make the design process easier, and provide a quick reference to check when you run into trouble. Translations are available in Français, Deutsch, Nederlands, Italiano, Magyar, Finnish, Russian, Portuguese, Japanese and Simplified Chinese. (No more will be posted.) CSS Tutorials: Centering with CSS, Links, Style Switching, Switchers, CSS Shorthand Properties - CSS Tutorials Tips - CSS Resources, Web Site Resources, Website Tips CSS Tutorials, Articles, and Tips, Page 6 Centering, Links, Scrollbars, Style Switching, Media Types, Selectors, CSS Shorthand The CSS Articles and Tutorials section below has links to helpful CSS tutorials on centering, style sheets for print, coloring scrollbars with CSS, how to use CSS shorthand properties, and more.

Quick Lookup : Info - PHP CSS MySQL JS Ref Updates * Yahoo! Widget - thanks Scott ! * Back page button CSS Menus - Vertical CSS Menu with Popout and Dropdown Menus This semantically correct Vertical CSS Popout Menu has been finalized as of 2005-02-28. See links below for supporting files. View source to see the HTML/XHTML and CSS that controls this vertical popout menu. Note from Claire at Tanfa: This CSS vertical popout menu uses the "whatever:hover" behavior file.

50 New CSS Techniques For Your Next Web Design Advertisement CSS is almost certainly one of the best developments in web design since the first graphical web browsers were adopted on a wide scale. Where tables created clunky, slow-loading pages, CSS created much more streamlined and usable web pages. Plus, CSS has allowed designers to achieve a number of different styles that used to only be possible with images. One of the best parts of CSS is that it’s so simple once you know the basics. Where tables used to make incredibly complex and sometimes impossible-to-decipher code, CSS keeps things clean and simple.

12 CSS Tools and Tutorials for Beautiful Web Typography 1139 shares 20 Fresh CSS3 Tutorials The design industry is probably one of the fastest changing and growing. Designers have to keep their eyes on everything, including new trends in visual design, as well as interaction technologies like jQuery, HTML5, and CSS3. CSS drop shadow Technique to build flexible CSS drop shadows applied to arbitrary block elements. Most of the existing techniques for creating element shadows use images, this one doesn't. IT uses plain simple CSS.

Advanced CSS Layouts: Step by Step - WebReference.com Abstract The Challenge: Replicate WebRef's front page using CSS. The Solution: CSS and lots of iterations. Rogelio Lizaolo improves on Kwon Ekstrom's CSS version of WebRef's tabled home page. Months in the making, the final design successfully duplicates WebRef's layout without the use of tables. Numerous bugs were discovered in Netscape and Internet Explorer in how they handle CSS, and we found some elegant workarounds to these and other problems.

Simple Clearing of Floats Without wanting to stray too deeply in Simon and Stuart’s technical CSS territory, I thought this was worth noting. For all it’s many advantages, sometimes it’s the little things that CSS layout makes difficult that really get to you. Clearing floated elements is a good example. The Problem: One of the simplest and most common layout structures involves the placing of a small, set-width DIV — perhaps navigation, a quote or a bio — within a larger wrapping DIV that contains the remaining content. In a markup this might be something like: Sliding Doors of CSS A rarely discussed advantage of CSS is the ability to layer background images, allowing them to slide over each other to create certain effects. CSS2’s current state requires a separate HTML element for each background image. In many cases, typical markup for common interface components has already provided several elements for our use. Article Continues Below

Super-Easy Blendy Backgrounds Recently, while trying to implement a few different navigation ideas that a designer had thrown my way, I became frustrated with my weak image editing skills. The design was gradient-heavy, so a traditional approach to navigation markup and styling would require a dozen or so background-image slices to meet the varying colors and height requirements. After spending a mortifying amount of time creating the images—I’m a programmer by trade, so anything more complicated than MS Paint gives me the willies—I had to take a step back and figure out a better way. What if, after finishing, I needed to tweak the height? CSS From the Ground Up - 1 Introduction If you are frightened by the prospects of using Cascading Style Sheets, there's no need to be. Using a computer can be daunting for someone coming to it afresh but after a while, you think nothing of it. It all comes down to taking small steps to begin with and that's what I'm going to do in this series of tutorials.

Related: