framework7

Open full view…

Centering Objects

Matthew B
Tue, 13 May 2014 19:56:21 GMT

In F7 is there a universal tag or label that can be attached to a element to make it centered within the webpage? If *not*, I would love to make that a feature request and also what would be the best way to center objects.

Vladimir Kharlampidi
Tue, 13 May 2014 20:25:58 GMT

No, there is no such feature by default. If you mean to center it horizontally and vertically then the best way is a flexbox. You should add these CSS rules to the direct parent of centered elemenent: --- display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center;

Matthew B
Tue, 13 May 2014 20:35:42 GMT

Ok thanks very much.... *Feature* *Request* Make a universal centering tag.

Vladimir Kharlampidi
Tue, 13 May 2014 21:14:35 GMT

But it hard to make it super universal because it highly depends on layout structure:)