Grupări
Poţi să oferi aveleaşi proprietăţi, mai multor selectoare, fără să fii nevoit să le scrii la fiecare în parte, aceleaşi valori.De exemplu dacă ai un cod de genul :
h2 {
color: red;
}
.UnSelectorClass {
color: red;
}
.AltSelectorClass {
color: red;
}
Poţi să scrii codul aşa :
h2, .UnSelectorClass, .AltSelectorClass {
color: red;
}
Adăugări
Dacă codul din documentul CSS este structurat bine, nu ar fi necesar să foloseşti în exces selectoare CLASS şi ID, pentru că poţi oferi unui selector, aceleaşi valori de la alt selector. Uite ce vreau să zic :
#top {
background-color: #ccc;
padding: 1em
}
#top h1 {
color: #ff0;
}
#top p {
color: red;
font-weight: bold;
}
Aplicarea în codul HTML ar arăta cam aşa :
<div id=“top”>
<h1>Despre biscuiţii cu ciocolata</h1>
<p>Asta este replica mea atunci când gust biscuiţi de casă, cu ciocolată!</p>
<p>Mmm mm mmmmm</p>
</div>
Aşadar selectorului “h1″, pe lăngă valorile şi proprietăţile pe care le avea selectorul “top” am mai adăugat şi culoarea #ff0, iar la “p” (tag-ul pentru paragraf) am mai adaugat stilul bold şi culoarea rosie.
Toată şmecheria asta, ar putea deveni puţin mai complicată dacă te duci cu valorile de la un selector, pentru alt selector, şi iar pentru altul, iar ca să le urmareşti şi să le reţii valorile ca să nu cumva sa le încurci, iti trebuie puţină practică, dar hai să fim serioşi, cât de greu vi se pare ?
![header=[] body=[andrew.cornett posted a photo:
Just squeezed out this HTML email in about an hour or so thanks to MailChimp!. ReadyTech HTML Email] andrew.cornett posted a photo:
Just squeezed out this HTML email in about an hour or so thanks to MailChimp!. ReadyTech HTML Email](http://farm4.static.flickr.com/3004/3048902260_14465ef17e_s.jpg)
![header=[] body=[Toni Panayotov posted a photo:
The first concept for the homepage of a school project. Client: Mambo Lounge Nightclub San Francisco CA. mambo_lounge] Toni Panayotov posted a photo:
The first concept for the homepage of a school project. Client: Mambo Lounge Nightclub San Francisco CA. mambo_lounge](http://farm4.static.flickr.com/3251/3047025017_eeef7db1e9_s.jpg)
![header=[] body=[tractorpirate posted a photo:
. www.m7lives.com] tractorpirate posted a photo:
. www.m7lives.com](http://farm4.static.flickr.com/3167/3046291353_4670b108ae_s.jpg)
![header=[] body=[comsodesign88 posted a photo:
planning on a new business card, so im starting to create som mock ups... business card mock up] comsodesign88 posted a photo:
planning on a new business card, so im starting to create som mock ups... business card mock up](http://farm4.static.flickr.com/3030/3046910170_5298b8d0e0_s.jpg)
![header=[] body=[SprittiBee posted a photo:
Who's scared? Looks like he is more than I am.. l-n-c2] SprittiBee posted a photo:
Who's scared? Looks like he is more than I am.. l-n-c2](http://farm4.static.flickr.com/3219/3046074967_077a125c2c_s.jpg)
![header=[] body=[tracystone posted a photo:
Website Design and development for Teahouse Media.
teahousemedia.com. Teahouse Media Website Design] tracystone posted a photo:
Website Design and development for Teahouse Media.
teahousemedia.com. Teahouse Media Website Design](http://farm4.static.flickr.com/3054/3046020827_68efee7d31_s.jpg)
![header=[] body=[Noah and Cat posted a photo:
In the next few months, life and time willing, I plan on starting a news website for the canal community in England, Ireland, Scottland and Wales. This is an in-progress design mock-up of where I'm headed. I'm not quite sure what to do with the bottom bit yet but I'm browsing other news sites for ideas.
The content right now is purely artificial. In most spots anyway.. Towpath Telegraph (In Progress)] Noah and Cat posted a photo:
In the next few months, life and time willing, I plan on starting a news website for the canal community in England, Ireland, Scottland and Wales. This is an in-progress design mock-up of where I'm headed. I'm not quite sure what to do with the bottom bit yet but I'm browsing other news sites for ideas.
The content right now is purely artificial. In most spots anyway.. Towpath Telegraph (In Progress)](http://farm4.static.flickr.com/3183/3045738255_8a8bd11d30_s.jpg)
![header=[] body=[jpguarin posted a photo:
Nueva pagina de VSP*
www.vsp.com.co. www.vsp.com.co] jpguarin posted a photo:
Nueva pagina de VSP*
www.vsp.com.co. www.vsp.com.co](http://farm4.static.flickr.com/3159/3045426395_e83cb3f50f_s.jpg)
![header=[] body=[kpucu.com posted a photo:
Redesign for www.bgstar.eu. BgStar.EU redesign] kpucu.com posted a photo:
Redesign for www.bgstar.eu. BgStar.EU redesign](http://farm4.static.flickr.com/3056/3045346683_ac042695e2_s.jpg)


