Answers for "css calc margin-top based on height?"

CSS
0

css calc margin-top based on height?

/*with margin-top the % is relative to width of parent element (kinda silly)
you can use top:50% which will be relative to height of the parent element*/
.my_element{
  top:50%
  position:relative;
}
Posted by: Guest on January-17-2022

Browse Popular Code Answers by Language