Margins thiab padding tuaj yeem tsis meej pem vim tias, qee txoj hauv kev, lawv zoo li tib yam: qhov chaw dawb nyob ib ncig ntawm ib qho duab lossis khoom. Nov yog yam koj ua tus tsim lub vev xaib yuav tsum paub txog lawv qhov sib txawv.
padding
Padding yog qhov chaw nruab nrab ntawm cov duab lossis cov ntsiab lus ntawm tes thiab nws cov ciam teb sab nraud. Nyob rau hauv daim duab hauv qab no, lub padding yog qhov chaw daj nyob ib ncig ntawm cov ntsiab lus. Hauv qhov no, padding mus tag nrho ib ncig ntawm cov ntsiab lus: sab saum toj, hauv qab, sab xis, thiab sab laug. Koj tuaj yeem hais qhia ntau npaum li cas padding (hauv feem pua, pixels, cov ntsiab lus, thiab lwm yam) rau txhua sab, thiab lawv tsis tas yuav zoo ib yam. Ua li no, koj tuaj yeem tso cov ntsiab lus hauv ib lub ntsiab lus.
Hauv qhov sib piv, cov npoo yog qhov chaw sab nraud ntawm tus ciam teb ntawm lub caij, nruab nrab ntawm lub caij thiab txhua yam uas nyob ib sab ntawm nws. Hauv daim duab, cov npoo yog thaj chaw dawb sab nraum tag nrho cov khoom. Zoo li cov padding, cov npoo mus tag ib ncig ntawm cov ntsiab lus hauv qhov piv txwv no: nyob rau sab saum toj, hauv qab, sab xis, thiab sab laug. Koj tuaj yeem siv margins rau txoj haujlwm divs thiab lwm cov ntsiab lus ntawm nplooj ntawv.
Ib txwm sim koj cov nplooj ntawv hauv ntau qhov browsers, kev khiav haujlwm (nrog rau lub xov tooj ntawm tes), thiab qhov screen loj kom paub tseeb tias lawv tso saib raws nraim li koj xav tau.