W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2017

[csswg-drafts] New attribute for block level vertical centering the content

From: Nadya678 via GitHub <sysbot+gh@w3.org>
Date: Wed, 29 Nov 2017 23:21:58 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-277944065-1511997717-sysbot+gh@w3.org>
Nadya678 has just created a new issue for https://github.com/w3c/csswg-drafts:

== New attribute for block level vertical centering the content ==
It is easy for me to define:
```
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`?
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.  



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2017 using your GitHub account
Received on Wednesday, 29 November 2017 23:21:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 29 November 2017 23:22:03 UTC