codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS padding

CSS padding

Space inside an element.

Padding sits between content and border. padding:10px 20px is vertical then horizontal.

Example code

<style>
p{background:gold;padding:30px 60px;display:inline-block}
</style>
<p>Padded</p>

Run this code in the online editor

← CSS marginsHeight and width →