Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

how to disable margin collapsing

/* This would create a small buffer between parent's and children elements's 
   margins. As such, margins won't collapse anymore.*/
.parentClass {
    padding: 0.05px;
}

/* Another solution would be to turn off margin-top on typography elements */
h1, h2, h3, p {
	margin-top: 0;  
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #disable #margin #collapsing
ADD COMMENT
Topic
Name
8+4 =