206k views
2 votes
In css, when two elements are vertically aligned, the distance between the two elements will be the _____ of the two margins.

1) sum
2) average
3) maximum
4) minimum

User Perplexed
by
7.0k points

1 Answer

3 votes

Final answer:

In CSS, the distance between two vertically aligned elements is the maximum of their two margins, not the sum or average.

Step-by-step explanation:

In CSS, when two elements are vertically aligned, the distance between the two elements will be the maximum of the two margins. If one element has a margin-bottom of 20px and the adjacent element has a margin-top of 30px, the space between the elements will be 30px, not 50px (the sum) or 25px (the average). This is due to the margin collapsing behavior in CSS.

User Ninaj
by
7.7k points