Today doubt session date 19 dec 2023

1-Which is closer to the content, margin or padding?
2-What is the order of the Margin and Padding CSS shorthand syntax?
3-How do you set the margin-top and margin-bottom values of a purely inline element?
4-When you see the the following, what is the web developer likely trying to do? margin : 0 auto ?

1-padding
2-top,right,bottom,left
padding:top px right px,bottom px,left px;
3-margin-top:value px;
margin-bottom:value px;
4-center

1 Like

Padding
css Syntex padding margin

1 Like

margin-top:value px;
margin-bottom:value px;
center

1 Like
  1. padding
  2. top, right, bottom, left
    3 .selector{margin-top: px; margin-bottom: px}
  3. to set the element exactly in centre
1 Like

2-top,right,bottom,left;
padding-top:value px;
padding-right:value px;
padding-left:value px;
padding-bottom:value px;

1 Like

1.border
2.in innermost box model padding comes after the content and margin comes after border
Box model
1.content 2.padding 3.border 4.margin
3.to set margin and padding for purely inline element we have to convert this element to as inline block using inline block property then we set padding and margin for that.
4.to make a element in center

1 Like

1.padding
2.margin-top,right,bottom,left
padding-top,right,bottom,left
selector{
margin: 1px, 1px, 1px, 1px;
padding: 1px 1px 1px 1px;
}
3.display property is set to inline
4.web developer is trying to horizontally center an element

1 Like
  1. Closer to the content padding
  2. Shorthand property for padding and margin
    Top , right, bottom ,left
    3.we can’t able to use margin and padding for purely inline element
  3. To make element center
1 Like