html - Vertically center text in an absolutely centered sphere -



html - Vertically center text in an absolutely centered sphere -

this question has reply here:

how align text vertically center in div css? 19 answers

i have tried couple of techniques, far nil works center text in absolutely centered sphere. size of sphere known, not length of text. here illustration lacking vertical alignment:

http://jsfiddle.net/eevw3oes/

css:

div { position: absolute; border-radius: 50%; top: 50px; width: 100px; height: 100px; background: yellow; overflow: hidden; vertical-align: middle; text-align: center; }

flexbox rescue: http://jsfiddle.net/eevw3oes/2/

div { align-items: center; display: flex; … }

this can accomplished adding more dom , using traditional css. see you're trying utilize vertical-align: middle, doesn't work on block elements (only inline-block , table-cell).

html css alignment centering

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -