Home Forums WoodMart support forum Indentation Consultation

Indentation Consultation

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #148177

    Evgeny Sviridov
    Participant

    Please tell me in what cases it is better to use “margin”, and in which cases “padding”? When setting up indents in the computer and mobile versions of the site via CSS.

    #148198

    Hello,

    Margin is an element’s personal space that how much distance the element wants to keep with other elements around it.

    Padding is how much an element is away from itself that how much distance an element wants to keep with the elements inside it.

    They both are used to create gaps around elements, but they differ in their method of creating that gap. Margin accommodates the gap by pushing adjacent elements away from it, while Padding accommodates the gap by either growing its own size or by shrinking the size of content inside it.

    By default, padding will increase the size of the element to accommodate the gap.

    Screenshot for better understanding: https://jmp.sh/M7MsjCS

    Hope the above instructions helps you to figure out when to use padding and when to use margin while adding custom css code in your site

    Best Regards.

    #148225

    Evgeny Sviridov
    Participant

    “Margin” can take a negative value, and “padding” always remains positive?

    #148255

    Hello,

    Padding by definition is a positive integer (including 0).

    Negative padding would cause the border to collapse into the content so this would make the content area smaller than the content, which doesn’t make sense.

    But browser still supports the negative padding. So you can use according to situation demand.

    Best Regards.

    #148259

    Evgeny Sviridov
    Participant

    Thank! You answered my question.

    #148262

    Hello,

    I’m so happy to hear you are pleased with the Theme and Support. XTemos strives to deliver the best customer experience, and it makes our day to hear we have accomplished that.

    We count ourselves lucky to have you as a customer.

    Thanks for contacting us.
    Have a great day.

    Topic Closed.
    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Indentation Consultation’ is closed to new replies.