The calc() CSS function is often used for calculating relative values. In the example below, what is the specified margin-left value?

Advertisement

.example {
margin-left: calc(5% + 5px);
}

  • The left margin value is equal to 5% of its parents element’s width plus 5px
  • The left margin value is equal to 5% of the viewport width plus 5px
  • The left margin value is equal to 5% of the closest positioned element’s width plus 5px
  • The left margin value is equal to 5% of the selected element’s width (.example) plus 5px
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend