margin şi padding sunt două dintre cele mai folosite proprietăţi ce descriu spaţiul dintre elemente, şi ele funcţionează astfel : margin se referă la spaţiul din exteriorul elementului şi padding la cel din interior.
Modificaţi CSS-ul pentru tag-ul h2, astfel :
h2 {
font-size: 1.5em;
background-color: #ccc;
margin: 1em;
padding: 3em;
}
Vei observa că spaţiul din jurul titlului etichetat cu tag-ul h2, este de marimea unei litere, iar textul e mai gros.
Cele patru părţi ale unui element (cadru) pot fi notate individual: margin-top, margin-right, margin-bottom, margin-left, padding-top, padding-right, padding-bottom şi padding-left. Toate enumerate te ajută să faci un element să arate cum doreşti.
Modelul de cutie (box model)
Margin, padding şi border sunt în acelaşi timp proprietăţi dar şi trăsături ale modelului standard de cutie.”Box model” funcţionează astfel: în centru avem conţinutul (să presupunem că e o poză), în jurul lui e “padding” , apoi “border” şi în final “margin“.
Nu este absolut necesar ca la fiecare element să precizezi aceste informaţii, dar e bine de stiut că orice element de pe pagina ta web poate avea setate aceste proprietăţi, şi cred că asta e un plus la controlul pe care îl ai asupra design-ului site-ului.
Cei care aţi parcurs tutorialul până aici, vreau să nu vă speriaţi de combinaţia română/engleză, încerc doar să vă fac cunoscuţi termenii, pentru că la scriere, nu veţi utiliza româna!!!
![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)


