Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

prevent child margin from moving parent 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
*/
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prevent #child #margin #moving #parent #css
ADD COMMENT
Topic
Name
1+3 =