Struggling with vertical alignments has proven to be more complicated than expected. Despite reading numerous resources on stackexchange, a common understanding of the process remains elusive.
After gathering some guidelines, it turns out that vertical-align doesn't function properly in <div>
elements unless you set
div {display: table-cell; vertical-align: middle}
.
The inconvenience is evident as table-cells override height limitations and adjust according to content, making the vertical center position variable.
An interesting observation from Pinterest's source code reveals that button {vertical-align: middle}
, leading to the assumption that buttons default to the middle alignment without additional commands.
If anyone could offer a comprehensive explanation of the vertical-align
attribute, detailing which html elements respond, have defaults, or non-overridable attributes, it would be greatly appreciated!
Insights into understanding these peculiarities are also welcome. Thanks in advance for any assistance!