2015-05-04 205 views

回答

0

您可以輕鬆地做到這一點用一點CSS

.card_position{ 
    margin-top:-70px 
} 

這個類添加到卡元件。

1

我想我會發布這個來幫助別人試圖用Materialise CSS做同樣的事情。您可以更改導航欄的高度以及卡的大小/位置。

enter image description here

Demo

HTML

<nav> 
    <div class="nav-wrapper"> 
     <a href="#" class="brand-logo left"><i class="material-icons">list</i></a> 
    </div> 
    <div class="nav-wrapper"> 
    </div> 
</nav> 
< 
<<div class="row" id="card-placement"> <!-- id added here --> 
    <div class="col s12 m8 offset-m2"> 
     <div class="card grey lighten-5"> 
      <div class="card-content grey-text text-darken-1"> 
       <h5 class="head">Title</h5> <!-- class added here --> 
       <div class="divider"></div> 
       &nbsp; 
        <p>Stuff goes here</p> 
      </div> 
     </div> 
    </div> 
</div> 

CSS

/* Moves card up into navbar */ 
#card-placement{ 
    margin-top:-60px 
} 
/* Moves Title position up to be level with nav bottom */ 
.head { 
margin-top: -2px; 
} 

nav { 
    color: #fff; 
    background-color: #ee6e73; 
    width: 100%; 
    height: 112px; 
    line-height: 56px; 
} 

.nav-wrapper { 
    margin-left: 20px; 
}