background preloader

CSS

Facebook Twitter

Simple scalable CSS based breadcrumbs. A few days ago I was implementing breadcrumbs in a website I’m working on. Not that I sincerely believe every site needs this, but on some occasions and to some users breadcrumbs are practical. Anyhow, it gave me the idea to write an article about it because it’s been a while since I last wrote about anything CSS-related.

The one I’ll share with you is a very simple one. It uses only one simple graphic. The rest is basic CSS styling with an unordered list as HTML code. The one I implemented in the project I'm working on looks a bit similar, but was more complex to code. The HTML code Here is our HTML code. <ul id="crumbs"> <li><a href="#">Home</a></li> <li><a href="#">Main section</a></li> <li><a href="#">Sub section</a></li> <li><a href="#">Sub sub section</a></li> <li>The page you are on right now</li> </ul> All items have links, except the page you're on. The CSS Here is the CSS styling: I've given the list an ID called #crumbs. We want to have the entire arrow area clickble.

Make OL list start from number different than 1 using CSS. If you need to create an OL list that starts from number different than 1, here is an elegant solution. This is very useful if you need to display a listing on more pages (eg. there are 100 search results, and you want to display 10 results per page). In this case, if you are using OL list, it will start from number 1 on every page, and that is not a good solution because it will look like this: In order not to use deprecated < ol start=”6″ > parameter in my second list, we’ve searched the Web for an adequate solution which complies with W3C standards – and we found it.

You need to write the following in your CSS: And, this is how your lists should be defined: These fieldsets represent separate pages, of course. All you need to do now is to dynamically change the value in your counter-reset rule. Li:before rule is used for defining the appearance of the number in your OL list. Automatic numbering with CSS Counters. Introduction When writing documents, it is often useful to number sections and have a table of contents. You can number these by hand, directly in the markup, but this can be time consuming if the order changes and you have to edit all the numbers. CSS 2.1 gives us a automated way to generate numbers using CSS counters, and this article will walk you through how to use them. One word of note before we start is that CSS counters are not yet implemented in IE, although they are on the roadmap for IE8. Setting up the counter The first step is to reset the counter to its base value and give it a name.

This says that the counter will be reset to zero on the <body> element, and the counter identifier is section. The reason for setting it at 4 is that it always increments the counter just before it displays it. Incrementing the counter The next step is to specify when the counter increments and by what value. If you’d like it to increment by two instead, you could specify it like so: Conclusion.

Exemple

Best CSS Forms. CSS has transformed the way forms used to get designed. CSS helps you make really good and attractive forms. Prior to this (CSS) the forms found on the web were very boring and were not able to attract a lot of visitors. Attractive or user-friendly forms can divert a lot of attention to itself. Even a simple form designed on CSS look slick and stylish. 1- Good Looking Form Without Table This tutorial will explain how to design good form using clean CSS design with only label and input tags to simulate an HTML table structure. 2- Nice & Simple Contact Form Simple CSS Forms is an easily-customizable forms setup that helps you create quick prototypes and final products of web sites. 3- CSS Globe Web Form Styles CSS Globe offers 5 web form styles, ranging from dark-and-slick to fun handwritten to old-fashioned letter envelope and more. 4- Semantic Horizontal Form 5- Veerle’s Blue CSS Form A simple blue form with rounded background corners, all styled in CSS and XHTML. 7- Simple CSS Forms.

Forms

Mise en forme CSS d'un formulaire accessible - CSS Debutant. Par défaut, les formulaires ne sont pas folichons. Pourtant, quel site n'a pas son formulaire ? (euh... mammouthland ?!!) Dès lors, la tentation est grande de mettre les champs dans des tableaux pour les aligner, et de rajouter du javascript pour un effet focus ou se passer un bouton d'envoi. Et l'accessibilité dans tout ça ?!! Mais avec les CSS, on peut améliorer l'aspect d'un formulaire et rester accessible ! Fonctionne avec : Firefox ; SeaMonkey MSIE 6+ Opéra Safari, Chrome Attributs utilisés : background-color border, border-radius box-shadow color cursor display font-family, font-size, font-weight margin padding width Les formulaires sont tristounets, et leur mise en forme n'est pas très jolie.En voici la preuve : Grâce aux feuilles de style, on peut facilement égayer tout cela.

Exemple Pour commencer, regardons le code HTML de plus près : Code (X)HTML <form action="toto.php" method="post" ><fieldset><legend> A propos des CSS : </legend><p>Savez-vous ce que veut dire CSS ? Code CSS Focus Haut.

Border

Le modèle des boîtes. Contenu Le modèle des boîtes de CSS décrit les boîtes rectangulaires qui sont générées pour les éléments de l'arbre du document et qui sont assemblées selon le modèle de mise en forme visuel. La boîte de page, qui en représente un cas particulier, est décrite plus en détails au chapitre sur les médias paginés. 8.1 Les dimensions des boîtes Chaque boîte possède une aire de contenu (ex. une texte, une image, etc.) entourée en option par une aire d' espacement , une aire de bordure et une aire de marge ; Le schéma suivant illustre les relations entre ces aires et la terminologie employée pour les désigner : On peut subdiviser la marge, la bordure et l'espacement selon qu'il s'agisse du côté gauche, droite, haut ou bas (ex. dans le schéma, "MG" mis pour marge gauche (N.D.T. margin-left), "ED" mis pour espacement droit (N.D.T. padding-right), "BH" mis pour bordure haute (N.D.T. border-top), etc.).

Le bord du contenu ou bord interne Celui-ci entoure le rendu du contenu de l'élément. Le bord de l'espacement. Border-radius: create rounded corners with CSS! Home / CSS3 Previews / Border-radius: create rounded corners with CSS! The CSS3 border-radius property allows web developers to easily utilise rounder corners in their design elements, without the need for corner images or the use of multiple div tags, and is perhaps one of the most talked about aspects of CSS3.

Since first being announced in 2005 the boder-radius property has come to enjoy widespread browser support (although with some discrepancies) and, with relative ease of use, web developers have been quick to make the most of this emerging technology. Here’s a basic example: This box should have a rounded corners for Firefox, Safari/Chrome, Opera and IE9. The code for this example is, in theory, quite simple: However, for the moment, you’ll also need to use the -moz- prefix to support Firefox (see the browser support section of this article for further details): How it Works border-bottom-left-radius, border-bottom-right-radius, border-top-left-radius, border-top-right-radius The Syntax:

Texte

CSS text-decoration property. CSS Font Properties. Generateur. Menu. Radio checkbox. Couleur. Div. Initiation au positionnement CSS : 3. position absolue et fixe. La position absolue et la position fixe permettent de placer une boîte par rapport aux limites de la zone d’affichage ou du conteneur. Comment les utiliser dans une mise en page CSS ? Cet article fait suite à l'initiation au positionnement CSS: 2.position float.

Une boîte en positionnement absolu peut être placée n'importe-où dans le code HTML et s'afficher à l'endroit de votre choix. Ceci s'avère très utile en particulier pour : placer les menus de navigation en fin de page, pour améliorer l'accessibilité de votre site en donnant un accès immédiat à son contenu dans les navigateurs textes, tout en les faisant apparaître en haut de page ou encore dans une colonne pour les navigateurs graphiques ; créer plusieurs colonnes au positionnement indépendant de l'ordre dans lequel elles se trouvent en HTML. Le fonctionnement de la position absolue Le positionnement absolu « retire » totalement du flux le contenu concerné : sa position est déterminée par référence aux limites du conteneur.

En CSS : World Wide Web Consortium (W3C)