CSS: commenti inline, variabili css, ereditarietà

18 01 2008

Propongo qui degli spunti per alcune regole di sintassi o funzionalità che mancano nei CSS.

Le proposte sono solo a titolo di esempio e probabilmente sono incomplete, servono solo per dare un’idea.

INDICE

  • commenti inline
  • variabili per il foglio di stile
  • raggruppamento di selettori
  • ereditarietà multipla delle regole applicati a selettori

Riporto qui di seguito degli esempi di codice che spiega queste funzionalità.
Leggi l’articolo intero »

2 Comments


CSS TRICK: Positioning with negative margin

5 08 2006

The following examples show how to set an object in an absolute position anchored at the center of the screen.

It’s very useful because if the size of the user screen changes the site is shown in the same way each time.

EXAMPLE:

To make this I’ve written these lines:

div #myBox
{
position: absolute;
top: 50%;
left: 50%;
width: 420px;
height: 240px;
margin: -210px 0 0 -120px;
}

This is the code that postions a DIV exactly at the center of the screen.

Leggi l’articolo intero »

Lascia un commento


CSS TRICK: Fixed in IE

5 08 2006

cover of the book The CSS anthology

An annoying problem with IE is that is impossible to “fix” objects on the screen like in Mozilla, with the standard property “position: fixed” of W3C

I read in the book “The CSS Anthology: 101 Essential Tips, Tricks & Hacks” by Rachel Andrew about a trick for fixing a footer bar in IE.

The position “fixed” makes an object be positioned like absolute but it still remains fixed on the screen when the page is scrolled.

Leggi l’articolo intero »

Lascia un commento


CSS TRICK: Code targeted only for IE

5 08 2006

How to write some CSS code that only Internet Explorer can read.

Unfortunately not every browser is W3C standards compliant, so sometimes we have to write some lines that only a specific browser can read.

Let’s see some filters and tricks to write code only for Internet Explorer.

Leggi l’articolo intero »

Lascia un commento