CSS Padding | Padding HTML
Paddingisusedtocreatespacearoundanelementscontent,insideofanydefinedborders.Thiselementhasapaddingof70px.TryitYourself»CSSPaddingTheCSSpaddingpropertiesareusedtogeneratespacearoundanelementscontent,insideofanydefinedborders.WithCSS,youhavefullcontroloverthepadding.Therearepropertiesforsettingthepaddingforeachsideofanelement(top,right,bottom,andleft).Padding-IndividualSidesCSShaspropertiesforspecifyingthepaddingforeachsideofanelement:padding-toppadding-rightpadding-bottompadding-leftAllthepad...
Padding is used to create space around an elements content, inside of any defined borders.
This element has a padding of 70px.
Try it Yourself » CSS PaddingThe CSS padding properties are used to generate space around an elements content, inside of any defined borders.
With CSS, you have full control over the padding. There are properties for setting the padding for each side of an element (top, right, bottom, and left).
Padding - Individual SidesCSS has properties for specifying the padding for each side of an element:
padding-top padding-right padding-bottom padding-leftAll the padding properties can have the following values:
length - specifies a padding in px, pt, cm, etc. % - specifies a padding in % of the width of the containing element inherit - specifies that the padding should be inherited from the parent elementNote: Negative values are not allowed.
ExampleSet different padding for all four...