What are margin and padding when do you use them?What is display property and explain ? Explain min-height,min-width,max-height and max-width in CSS?

What are margin and padding when do you use them?What is display property and explain ? Explain min-height,min-width,max-height and max-width in CSS?

  1. What are margin and padding when do you use them?

Ans:- Margin: Outside space surrounding an element.

       **Padding:** Inner space surrounding an element.

We use margin and padding for maintaining space between the elements, better readability of contents in viewports etc.

  1. What is display property and explain display inline, block and inline-block ?

Ans:-Display property defines how the elements will be displayed on the webpage.

Display: inline; means the element will take the space as much required to show content on the web page and it also allows other inline elements to come side by side.

Display: block; means the element will take the whole space in the horizontal row according to the height of the element i.e. more space will be taken than required to show content on the web page and it does not allow other elements to come side by side.

Display:inline-block; means the element will take the space as much required to show content in the web page and it also allows other inline elements to come side by side. The main feature is we can assign the height and width of the element.

  1. Explain min-height,min-width,max-height and max-width in CSS?

Ans:- min-height: Used to set the minimum height of an element.

      **min-width:** Used to set the minimum width of an element.

      **max-width:** Used to set the maximum width of an element.

      **max-height:** Used to set the maximum height of an element.