A Comprehensive Guide to CSS Resets
This guide examines the infinite-like variety of CSS resets created by web developers and designers across the world. While almost all of these CSS resets are generally provided free for public use (many through Creative Commons licensing), it is incumbent upon you to check the terms of use before putting them to use in your projects. This guide follows Part 1, where the history of CSS resets was discussed; you’re advised to read that before this one to get the most out of this guide. This is Part 2 of a three-part series of articles on the topic of CSS resets. In putting together this guide, the 2007 collection of resets by Jeff Starr — who, as an aside, has contributed articles on Six Revisions — was used as a jumping-off point. "Hard" Reset As discussed in Part 1 of this series, the original version of the "hard" reset was by web designer Andrew Krespanis: It wasn’t long before folks added border: 0; and outline: 0; to the list of properties, giving us: Poor Man’s Reset Siolon Reset
3 astuces CSS fort utiles
Voici quelques astuces CSS assez utiles, mais très peu utilisées. Au menu : Bien utiliser <HTML> et <BODY>Appliquer un style à tous les éléments.Donner plusieurs « class » à un élément Bien utiliser <HTML> et <BODY> <HTML>, comme tout autre élément, peut être personnalisé via les CSS. Appliquer un style à tous les éléments. Il est possible d’appliquer un style général à tous les éléments, via * Cette technique est utilisée par certaines feuilles de Reset CSS, pour appliquer des marges intérieurs et extérieures de 0 par défaut sur tous les éléments. Donner plusieurs « class » à un élément Il est possible de donner plusieurs valeurs à un attribut class, ce qui permet de gérer plus proprement certains éléments. avec comme résultat « texte rose et souligné« . edit : comme l’a noté Kazhar dans les commentaires, il faut nommer ses classes CSS en fonction de l’utilité de l’élément, mais pour le coup, il me fallait un exemple facile à comprendre, et à expliquer
Image Reflections with CSS
Image reflection is a great way to subtly spice up an image. The first method of creating these reflections was baking them right into the images themselves. Within the past few years, we've introduced JavaScript strategies and CANVAS alternatives to achieve image reflections without having to modify original images. The minds behind WebKit have their own idea behind image reflection: pure CSS. The Webkit CSS The -webkit-box-reflect property accepts a value in the following format: -webkit-box-reflect: <direction><offset><mask-box-image> A sample usage of -webkit-box-reflect looks like: An involved CSS value but well worth the work. WebKit first implemented CSS reflections in 2008 and, to my knowledge, no other browsers have implemented a similar API. Be Heard Tip: Wrap your code in <pre> tags or link to a GitHub Gist! Older Accomplishing Common Tasks Using MooTools, jQuery, and Dojo III Newer Dijit's TabContainer Layout: Easy Tabbed Content
25 Incredibly Useful CSS Snippets for Developers
CSS is no doubt up there with the most important web languages that we use. While html provides the structure it can be inconsistent and unpredictable across different new and old browsers. Css is where the html is styled though, and where we get creative as well as addressing those inconsistencies. Hide text with text indent This is extremely useful for use for things such as your company logo. Style links depending on file format This snippet is aimed at user experience. Remove textarea scrollbar in IE Internet Explorer has an annoying habit of adding scrollbars to textarea’s even when the textarea’s content is not overflowing. Drop cap Commonplace these days in blogs and news sites is the dropcap. Css Transparency Transparency is something that isn’t done the same way across browsers which can be annoying. Css Reset by Eric Meyer Eric Meyer’s css reset has become almost standard now days for use at the start of your stylesheet. Image preloader Basic css sprite button Google Font API Clearfix
CSS Triangles
This post has been updated to include CSS triangles without markup via :before and :after pseudo-elements. I was recently redesigning my website and wanted to create tooltips. Making that was easy but I also wanted my tooltips to feature the a triangular pointer. I'm a disaster when it comes to images and the prospect of needing to make an image for every color tooltip I wanted made me rethink my redesign. Lucky for me, MooTools Core Developer Darren Waddell shared with me a great trick: CSS triangles. Using pure CSS you can create cross-browser compatible triangles with very little code! The CSS The secret to these triangles is creating giant borders to the two perpendicular sides of the direction you'd like the triangle to point. CSS Triangles with :before and :after The CSS examples above uses true elements but what if you don't want to add single triangles? The border side you add the color to is the opposite side of the arrow pointer.
25 CSS Snippets for Some of the Most Common and Frustrating Tasks
In this post we have 25 CSS snippets and hacks that will solve many of the most frequently used and, at times, frustrating CSS development tasks. Why reinvent the wheel when there are already plenty of time-saving pre-written CSS code snippets? As well as some classic and timeless CSS hacks you will also find many CSS3 snippets, like box-shadow, border-radius,linear-gradient and many more. Adding shadow to text – text-shadow Helps make your text stand out from the rest. Source Adding an image-based border – border-image You can create any kind of border you want for any object(s) on your website using this. Adding shadow to borders and images – box-shadow Helps make your borders and images “pop” from the background more, giving a subtle 3D-like visual cue that it’s something separate, in the foreground, and the thing that visitors should be looking at. Adding rounded corners – border-radius Self-explanatory. Adding individual rounded corners – border-radius Adding a gradient – linear-gradient
Word-Wrap: Force Text to Wrap
Today I'm going to talk about a rarely used but extremely useful CSS property, the word-wrap. You can force long (unbroken) text to wrap in a new line by specifying break-word with the word-wrap property. For example, you can use it to prevent text extending out the box and breaking the layout. CSS: Word-Wrap Property (view demo) You can specify either normal or break-word value with the word-wrap property.
Display inline-block, une valeur trop peu utilisée
Floatera, floatera pas… mais pourquoi ne pas utiliser la valeur inline-block de la propriété display en CSS ? Vous connaissez certainement les valeurs block ou inline, mais moins celle de inline-block et pourtant elle peut vous servir dans bien des cas. Voyons dans quelles conditions nous pouvons l'utiliser (de manière non exhaustive) dans un premier temps, puis dans un second temps quelques difficultés dans son utilisation. Cette astuce a été publiée initialement sur le blog personnel de l'auteur, creativejuiz.fr à la date du Jeudi 17 mars 2011. Utiliser display: inline-block Par défaut les éléments input ont comme valeur de display celle de inline-block. Le formulaire Quelle transition ! Je vous propose cette forme de mise en page pour formulaire. Notre code CSS va donc nous permettre d'avoir un comportement homogène. La CSS : Aperçu du formulaire Une navigation horizontale (éléments de liste) Le code HTML : Le code CSS : Remarque : la valeur inline sur le li est suffisante dans mon exemple.