Answers for "vertically and horizontally center a fixed div"

CSS
0

vertically and horizontally center a fixed div

// you dont need to know the divs dimensions and it does not require any container divs
position: fixed; 
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
Posted by: Guest on August-20-2020
0

center a fixed div horizontally

left: 50%;
transform: translateX(-50%);
Posted by: Guest on December-06-2019

Code answers related to "vertically and horizontally center a fixed div"

Browse Popular Code Answers by Language