Parlami del tuo progetto

Edit Template

Consigli su come chiamare i nostri selettori css

Alen Grakalic ci da dei consigli molto semplici e pratici su come chiamare i nostri selettori, districandosi fra classi, id, gerarchie e parentele (sto sempre parlando di css si intende ahah).
Secondo me è molto chiaro e semplice.
Ecco uno stralcio dell’articolo:

Combinations

#main h2.title span

This type of selector allows you to be very precise in targeting an element.
The principle I use is: I try to determine the lowest container in hierarchy that has non-repeating elements. I add class name to the container and target the elements inside with type selectors similar to example above. If you have a H2 tag that you use for titles, and you have only one span inside it, there’s really no need of adding a class name to that span. You can easily target it with combined selector shown above.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Inviami subito il pdf:

"Trovare nuovi clienti, da dove cominciare?"

Ricevi SUBITO il pdf di 16 pagine con i consigli pratici da mettere in atto immediatamente e cominciare a ricevere i tuoi primi clienti grazie al web.

Lauryn è un progetto che esiste dal 2001 ed è ideato da Laura Gargiulo, web designer ed esperta di web marketing.

Laura Gargiulo | professionista ai sensi della Legge 4/2013 | Via Arrigo Minerbi 3, 20142 Milano – PI IT10339790965‬ |
Tutti i diritti riservati© 2025