Closed masakudamatsu closed 5 years ago
By default, the scaling image is top-aligned. This may not be useful if the meat of the image is located around the center.
A StackOverflow discussion on vertically center-aligning an image gives a nice solution, with the use of relatively absolute positioning (cf. Interneting Is Hard's tutorial on absolute positioning).
.figure__frame { position: relative; } .figure__image { margin: auto; position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
By changing the values for the top/bottom/left/right properties, we can fine-tune the positioning of a scaling image.
By default, the scaling image is top-aligned. This may not be useful if the meat of the image is located around the center.
A StackOverflow discussion on vertically center-aligning an image gives a nice solution, with the use of relatively absolute positioning (cf. Interneting Is Hard's tutorial on absolute positioning).
By changing the values for the top/bottom/left/right properties, we can fine-tune the positioning of a scaling image.