samuelcrockford
samuelcrockford
Reputation Top 10%
samuelcrockford
1 Snippet  (338th place)
Published
1 Channel
Created
1 Channel
Following
Mar 14, 2019
Last Visit
Mar 14, 2019
Registered
30 points  (1147th place)
Reputation
Junior Code Generator
Junior Publisher
Junior Autobiographer
Serious Autobiographer

Recent Snippets See all snippets by samuelcrockford

public by samuelcrockford created Mar 14, 2019  58  1  3  0

Centre child inside its parent - Old School Way

How to centre a div vertically and horizontally inside its parent
/* Center a div - The old school way*/
.parent { /* Center my child relative to me */
  position: relative;
}
.child { /* Center me inside my parent*/
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
;