prevent child margin from moving parent css example code

prevent child margin from moving parent css example code

prevent child margin from moving parent css example

prevent child margin from moving parent css example in css

/* Prevent Child Margin from Moving Parent */
.parent {
  margin: -1px;
  padding: 1px;
}
/* Alternatively */
.parent {
    display: flow-root; /* no supported by IE 11 */
}
/*
Learn more: https://www.w3.org/TR/CSS2/box.html#collapsing-margins
*/
By Manish Salunke In css -

Tags:

css

Sponsors

themeforest
pluralsight
Invest in you. Online courses as low as $11.99