background preloader

CSS Almanac

CSS Almanac
Related:  cssFaire un site en JS

CSS - Smashing Magazine Today Smashing Magazine turns eight years old. Eight years is a long time on the web, yet for us it really doesn't feel like a long journey at all. Things have changed, evolved and moved on, and we gratefully take on new challenges one at a time. To mark this special little day, we’d love to share a few things that we’ve learned over the last year about the performance challenges of this very website and about the work we’ve done recently. Improvement is a matter of steady, ongoing iteration.

/ tapety na Plochu Les fondamentaux du Responsive Web Design Prenons deux exemples simples. Le premier pourrait être ces vitres qui s'opacifient en fonction de la luminosité extérieure. Ou encore ces murs-miroirs où plus nous nous approchons, plus ils nous semblent se déformer. Le « Responsive Web Design » est né, car nous sommes de plus en plus confrontés aux mêmes problèmes que les architectes : s'adapter aux supports. Voyez plutôt : autrefois, nous n'avions qu'un ou deux navigateurs et les tailles d'écrans variaient peu. Et tout cela, c'est ce que nous avons maintenant. Pour faire une application Web qui soit Responsive Web Design, nous devons établir les trois points suivants : Si nous faisons une analogie avec l'architecture, les trois derniers points représentent nos outils. Il est heureusement possible de s'adapter pour y parvenir. Avant toute chose, il faut faire en sorte de créer un site dont la grille d'affichage soit flexible. Une fois cela fait, nous allons modifier à la fois la taille des polices et la taille de nos éléments. <! VI-A.

Troubleshooting CSS Sometimes CSS can be frustrating. Learn about some tricky properties, the common issues they can cause and how to solve them. CSS is a mess. First introduced in ~1995, it was meant to style basic text documents. Not websites. A lot of things were not intended in the first place like multi-column layouts, responsive web design and more; this is why it has become a language full of hacks and glitches, like some kind of odd steam machine with a bunch of extensions. On the bright side, this is what makes CSS fun (or kinda)! Photo credits Anyway, I’m not here to talk about my convictions but about CSS. Among others, I picked some really common yet annoying issues: Float clearing, an old battle I think this has to be the most common wat? Basically, when an element only contains floated elements, it collapses on itself. There are a number of ways to fix this. Then Nicolas Gallagher came with a new way to clear floats from the parent without touching the markup at all. Hey, it’s better! Why? Why?

CSS Beauty | CSS Design, News, Jobs, Community, Web Standards 6 Methods For Vertical Centering With CSS Centering elements vertically with css is something that often gives designers trouble. There are however a variety of methods for vertical centering and each is fairly easy to use. Today I want to present 6 of those methods. I’ve usually skipped over the topic of vertical centering, since there are some good posts already out there that are easy enough to find, but recently Bikram commented requesting a tutorial on vertically centering so I thought why not. You can view demos of each of the methods below by clicking here. Let’s start by first talking about something that doesn’t work as many expect. Vertical-Align Horizontal centering with css is rather easy. With text-align: center in mind, most people look first to vertical-align in order to center things vertically. However valign only worked on table cells. The values for vertical-align have meaning with respect to a parent inline element. Line-Height Method html css Centering an Image with Line-Height CSS Table Method Floater Div Summary

jQuery – Effet smooth scroll (défilement fluide) Cet article a 3 années. Il commence à dater, lisez-le donc en gardant son âge en tête ! Merci publié le Lu 110 465 fois. L’effet de scroll fluide est déjà intégré, en fonction de vos paramètres utilisateur, sur certains navigateurs. Il y a quelques temps de cela (peut-être trois ans maintenant) j’avais trouvé un script JS pour ajouter cet effet, mais celui-ci ne prenait en compte que les ancres dotées de l’attribut name, sous cette forme : <a href="#cible">Aller à "cible"</a> <a name="cible"></a> Or la création d’un élément anchor dans le seul but de créer une ancre ne me semblait pas la méthode la plus propre, mais comme j’étais une quiche en JavaScript (ça n’a pas trop changé d’ailleurs, puisque j’utilise principalement jQuery pour me faciliter l’existence), j’ai fait avec ce code jusqu’à ce que je découvre jQuery et le plugin jQuery.scrollTo(). C’est pourquoi aujourd’hui je vous propose de créer votre propre script jQuery de smoothscroll. Solution de base Voyons le code de plus près :

The Definitive Guide to CSS Transitions Back in the golden days of the web, we had a little thing called Flash to help us make the web a dynamic, fun, interactive place. But, Flash is being used less and less. Of course, in certain environments it can still be put to amazing use, but in today’s web environment you need CSS to get the job done. One of the easiest ways to give your site a near-instant facelift is to bring CSS3 transitions to the table (pun intended). As users interact with various elements on your page, transitions allow for a delayed response that is far more natural and engaging than a jarring, instant response. Case in point, hover over these two boxes and tell me which is more interesting to you. Drop this into an HTML document and check it out: Yeah, I know gray boxes aren’t all that exciting, but the point is that the transitions on the box to the right are more interesting and give the design a more polished feel. Pseudo-Classes for CSS Transitions Introducing CSS Transitions Properties of the CSS Transition

CSS Buttons: Tutorials and examples Creating buttons with CSS is one of the most experimented-with web design techniques around. Examples and tutorials abound. The biggest recent trend in CSS button design seems to be eliminating images, especially background images, from buttons. But there are plenty of other things designers are doing with buttons, some that do include images. Below we’ve collected more than twenty tutorials, examples, and tools for creating CSS buttons, most of which use CSS3. Included are buttons to suit virtually every design style. If you have other tutorials or examples you’d like to share, please do so in the comments! Tutorials and articles Rediscovering the button element A really helpful article discussing the button element in CSS, which is often overlooked by designers. Beautiful CSS buttons with icon set Here’s another article that talks about how to create buttons with icons, though using span classes rather than the button element. Build kick-ass practical CSS3 buttons Pretty CSS3 buttons

Hover.css - A collection of CSS3 powered hover effects All Hover.css effects make use of a single element (with the help of some pseudo-elements where necessary), are self contained so you can easily copy and paste them, and come in CSS, Sass, and LESS flavours. Many effects use CSS3 features such as transitions, transforms and animations. Old browsers that don't support these features may need some extra attention to be certain a fallback hover effect is still in place. Licenses Hover.css is made available under a free personal/open source or paid commercial licenses depending on your requirements. Personal/Open Source For personal/open source use, Hover.css is made available under a MIT license: Use in unlimited personal applications Your application can't be sold Your modifications remain open-source Free updates Read full license Commercial For commercial use, Hover.css is made available under Commercial, Extended Commercial, and OEM Commercial licenses. Commercial License Purchase | Read full license Extended Commercial License

Building A RESTful PHP Server: Understanding the Request Once upon a time, what seems like a lifetime ago, I was away for a couple of weeks, and I wrote a series of posts about serving RESTful APIs from PHP to keep my blog going while I was away. Fast forward a few years and those posts are outdated and still wildly popular - so I thought it was about time I revisited this and showed how I'm writing RESTful PHP servers today! In the first part of this (probably) 3-part series, we'll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I've put in code samples from from a small-scale toy project I created to make me think about the steps involved (should I put the code somewhere so you can see it? Let me know). Send Everything to index.php This assumes you're using apache with mod_rewrite; the same thing can be achieved with other webservers. Figure Out What Was Requested Incoming Data

Flexible CSS cover images I recently included the option to add a large cover image, like the one above, to my posts. The source image is cropped, and below specific maximum dimensions it’s displayed at a predetermined aspect ratio. This post describes the implementation. Demo: Flexible CSS cover images Known support: Chrome, Firefox, Safari, Opera, IE 9+ Features The way that the cover image scales, and changes aspect ratio, is illustrated in the following diagram. The cover image component must: render at a fixed aspect ratio, unless specific maximum dimensions are exceeded;support different aspect ratios;support max-height and max-width;support different background images;display the image to either fill, or be contained within the component;center the image. Aspect ratio The aspect ratio of an empty, block-level element can be controlled by setting a percentage value for its padding-bottom or padding-top. Changing that padding value will change the aspect ratio. Maximum dimensions Background image Final result

CSS Layout Generator This is really just a step in the right direction, you still have a lot to do before your site is ready to go live. If you are just starting out, learning to do it yourself, by hand, in a simple text editor can be very rewarding, although it won't be easy. Below is some information that will help you on your journey, good luck. Layout Hints These simple tips may save you from having to use complicated hacks on your site. Column Padding Overflowing Content in Fluid Layouts To avoid content escaping or overflowing the columns there are a couple of things you can do. Rounding Up For help with styling your template, or to let me know your thoughts on the CSS layout Generator join the CSS Forum community.

CSS3 Transform to Matrix Filter converter This is the hardest of all the transform functions to understand unless you are mathematically gifted. However, for those who are stubborn, geeky, or both, a brief explanation follows. If you don't undertand everything below, don't fret — you'll probably never use this function. This function is almost the direct equivalent to Microsoft's Matrix Filter. transform: matrix(1, 2, 3, 4, 0, 0); is the same as this statement: filter: progid:DXImageTransform.Microsoft.Matrix( M11=1, M12=3, M21=2, M22=4, SizingMethod='auto expand'); Note that c and b are out of order. The last two numbers, tx and ty , are the translation factors for the object. transform: matrix(1, 0, 0, 1, 22px, 33px); is the same as this statement transform: translate(22px, 33px); and this mathematical notation: Note: at the time of this writing, Firefox (version 3.6) requires units for tx and ty (such as px or em ) which Safari 4, Opera 10.10 and Chrome 5.0 require units not be supplied.

Related: