zdhxiong / mdui

Material Design 3(Material You) UI components using Web Components.
https://www.mdui.org
4.17k stars 364 forks source link

mdui-valign&mdui-center 同时使用时可以垂直居中,但水平居中失效? #139

Closed finnonly closed 6 years ago

finnonly commented 6 years ago

这是一个(可多选)

`

测试

</div>`
zdhxiong commented 6 years ago

因为你加了 position:absolute 被定位到了左上角,去掉就好

finnonly commented 6 years ago

如果我想要测试 <div class="mdui-spinner"> 这些内容水平垂直居中呢? 用这两个类能做到嘛? @zdhxiong

zdhxiong commented 6 years ago
<div class="mdui-valign mdui-center mdui-shadow-16" style="width:300px; height:60px;">
   <div class="mdui-center mdui-valign">测试 <div class="mdui-spinner"></div></div>
</div>
finnonly commented 6 years ago

@zdhxiong close... 我刚刚又看了下代码,mdui-valign 对子元素有效,mdui-center只对元素本身有效 ╯︿╰