background preloader

Div

Facebook Twitter

CSS: Centrer un objet. See also the index of all tips.

CSS: Centrer un objet

Centering lines of text The most common and (therefore) easiest type of centering is that of lines of text in a paragraph or in a heading. CSS has the property 'text-align' for that: renders each line in a P or in a H2 centered between its margins, like this: The lines in this paragraph are all centered between the paragraph's margins, thanks to the value 'center' of the CSS property 'text-align'. Centering a block or image Sometimes it is not the text that needs to be centered, but the block as a whole.

This rather narrow block of text is centered. This is also the way to center an image: make it into block of its own and apply the margin properties to it. CSS3 Shadows. CSS3 nous apporte des brides du côté obscur de la force en proposant de gérer des ombres diverses et variées directement depuis votre feuille de styles : blocs et textes sont concernés avec également la combinaison de plusieurs ombrages pour obtenir des effets avancés.

CSS3 Shadows

Les ombres portées prennent aujourd’hui une place importante dans le web design et permettent la mise en exergue d’éléments importants, ou l’ajout d’une touche de profondeur dans vos graphismes. Il est possible de dire adieu aux images superflues uniquement destinées à la réalisation d’ombres portées ; adieu à la soupe de <div>, <span>, et autres structures en tableau pour réaliser des effets graphiques riches. 3 Column CSS Layout: Fixed Width And Centered. Last week I shared the code I use to start a 2 column fixed width layout.

3 Column CSS Layout: Fixed Width And Centered

Today I want to expand that code and share how I’d build a 3 column layout that’s also of fixed width and centered on the page. Many of the concepts will be the same as in the previous post so I’ll skip some of the details here. If you need more explanation than this post has I’ll refer you back to the 2 column layout post. There will be some new concepts when we try to move the columns around for which I’ll offer a more detailed explanation. For those who prefer to skip the explanation here’s a demo of what we’ll be building and you can view the source for the code.

The HTML As with the 2 column layout, the html for a 3 column layout is rather simple. Instead of using sidebar-1 and sidebar-2 I’m calling the sidebars primary and secondary. One point to make about the html is the order of the divs. I’ll get to the details in a bit, but with 3 columns there are 6 potential ways to order those columns. The CSS Not bad.

960 Grid System. Simple 2 column CSS layout. This is a tutorial on how to use CSS to create a simple two column layout.

Simple 2 column CSS layout

If you want to create a three column layout, read on as this tutorial explains a basic concept that can be used to create as many columns as you need. When you’re done, take a look at How to create a 3-column layout with CSS. The layout consists of a header, a horizontal navigation bar, a main content column, a sidebar, and a footer. It is also horizontally centered in the browser window. A pretty basic layout, and not at all difficult to create with CSS once you know how to deal with the inevitable Internet Explorer bugs. To see the full CSS used for each step, view source on the example documents. 1. First of all, we create the basic HTML structure: After that, we put some content in the different sections: [CSS] superposer texte par apport a une image [Résolu]

T'as de la chance, je me suis pris la tete pour ca !!!

[CSS] superposer texte par apport a une image [Résolu]

Je pensais que ca serait assez simple, mais pas vraiment... Il existe en CSS, l'attribut position: relative. Problème : si tu mets ton image du dessous en position relative, et ton image du dessus aussi, l'image du dessus se positionnera par rapport au bas de ton image du dessous (dont le code est au dessus... tu me suis :-p ). Il y a 2 astuces : - Soit tu crées un DIV avec un style="background-image:url(tonimage.jpg); width: 562px; height:347px;" et tu places ton image du dessus en position relative par rapport au div, puisque ton image du dessous est dans les propriétés de la balise DIV : Superimpose text over an image by using CSS-styled text. If your page design calls for a photo with superimposed text, you don't have to create an image file that includes both the photo and the text.

Superimpose text over an image by using CSS-styled text

Instead, you can use CSS to keep the text and image separate and still achieve the desired effect. This article is from Builder.com's Design and Usability Tactics e-newsletter. Sign up instantly to begin receiving the Design and Usability Tactics e-newsletter in your inbox. How would you handle a page design that called for a photo with superimposed text? The common approach has been to create an image file that includes both the photo and the superimposed text, and insert it into your page with an <img> tag.

It may be time to rethink that standard solution.