You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html
{
display:table;
width:100%;
border:none;
border-spacing: 0px;
height:100%;
}
body
{
display:table-cell;
vertical-align:middle;
/* here add padding to make area for fixed-positioned elements like menu, nav-bar*/
}
but centering of content inside other elements is hard. There is no ideal solution.
Can you add style: display: block-cell (and probably inline-block-cell)?
Display like block but with working: vertical-align:bottom and vertical-align:middle;
I know, I can use flexbox but... I must add additional container to do it and flexbox has additional adverse effects for elements inside it.
The text was updated successfully, but these errors were encountered:
Nadya678
changed the title
New attribute for block level vertical centering the content
[CSS-align] New attribute for block level vertical centering the content
Nov 29, 2017
BTW. If in the example is more text inside <body/> - which element should have defined scrollTop property? (overflow: scroll doesn't work for table elements - I suggest document or window but please test Cr, IE and FF).
<body/>
<html/>
document
window?
Nadya678
changed the title
[CSS-align] New attribute for block level vertical centering the content
[CSS-align][CSSOM] New attribute for block level vertical centering the content
Nov 29, 2017
Thank you for explanation. This style will solve this problem if it will be implemented.
BUT what about CSSOM [scrollTop] for display:table on <html/> element described here? Shall I put new issue?
Uh oh!
There was an error while loading. Please reload this page.
It is easy for me to define:
but centering of content inside other elements is hard. There is no ideal solution.
Can you add style:
display: block-cell
(and probablyinline-block-cell
)?Display like block but with working:
vertical-align:bottom
andvertical-align:middle;
I know, I can use flexbox but... I must add additional container to do it and flexbox has additional adverse effects for elements inside it.
The text was updated successfully, but these errors were encountered: