中心列实现

时间:2016-02-29 17:07:56

标签: materialize

我有这个HTML代码:

<div id="login-page" class="row">
    <div class="col s12 m6 l4 z-depth-6 card-panel teal">
        <h1>Hi</h1><br/>
    </div>
</div>

我想要一个以l4和m6为中心的列。 s12做得很好,但l4总是留在大屏幕的左边。我如何将这些列居中?

1 个答案:

答案 0 :(得分:5)

尝试将等级 <!-- Automatically apply icons to context menus based on the header value --> <Style x:Key="DecoratedMenuItem" TargetType="MenuItem" BasedOn="{StaticResource MenuItem}"> <Style.Resources> <clr:Double x:Key="CanvasSize">16</clr:Double> <converters:IgnoreUnderscoresConverter x:Key="IgnoreUnderscoresConverter" /> <Binding x:Key="HeaderBinding" Path="Header" RelativeSource="{RelativeSource Self}" Converter="{StaticResource IgnoreUnderscoresConverter}" /> </Style.Resources> <Style.Triggers> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Run" Canvas="{StaticResource appbar_control_play}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Edit" Canvas="{StaticResource appbar_edit}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Delete" Canvas="{StaticResource appbar_delete}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Install" Canvas="{StaticResource appbar_social_dropbox_download}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Uninstall" Canvas="{StaticResource appbar_delete}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Advanced" Canvas="{StaticResource appbar_tardis}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Undo" Canvas="{StaticResource appbar_undo}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Redo" Canvas="{StaticResource appbar_redo}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Exit" Canvas="{StaticResource appbar_close}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Close" Canvas="{StaticResource appbar_close}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Copy" Canvas="{StaticResource appbar_page_copy}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Cut" Canvas="{StaticResource appbar_scissor}" /> <local:IconTrigger Binding="{StaticResource HeaderBinding}" IconSize="{StaticResource CanvasSize}" Value="Paste" Canvas="{StaticResource appbar_clipboard_paste}" /> </Style.Triggers> </Style> offset-m3添加到您的div:

offset-l4