2016-12-23 1 views
0

はここに私のページです: enter image description herecol-md-6でJumbotronを作成するには両側の中央に配置しますか?

問題がある、私のジャンボトロンは、ページの上部に配置しました。私はそれをセンターに移動したい(少し下に)。私は余白とパディングを無効にしようとしましたが、それでも動作しませんでした。どうすればいい?

ここ

<div class="col-md-6"> 
    <div class="welcome-page-eat"> 
     <div class="jumbotron"> 
      <h2> 
       Hello, world! 
      </h2> 
      <p> 
       This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique. 
      </p> 
      <p> 
       <a class="btn btn-primary btn-large" href="#">Learn more</a> 
      </p> 
     </div> 
    </div> 
</div> 

そして、ここでは私のCSSだ私のHTMLです:

.welcome-page-eat { 
    background: url(../images/front_page/eat.jpg) no-repeat right 0; 
    margin-right: -15px; 
    margin-left: -15px; 
    padding-bottom: 62.5%; 
    background-position: 50% 50%; 
    background-repeat: no-repeat; 
    background-size: cover; 
} 

.welcome-page-cook { 
    background: url(../images/front_page/cook.jpg) no-repeat right 0; 
    margin-right: -15px; 
    margin-left: -15px; 
    padding-bottom: 62.5%; 
    background-position: 50% 50%; 
    background-repeat: no-repeat; 
    background-size: cover; 
} 

.jumbotron { 
    background-color: transparent; 
    color: white; 
} 
+0

あなたはそれが垂直にセンターしたいと思っていますか?はいの場合は、ここで何度も議論されています。例:http://stackoverflow.com/questions/8865458/how-to-vertically-center-text-with-css –

+0

あなたは一番上からではなく、一番下からパディングしました。 – Rogue

答えて

0

使用してみてください:

.jumbotron { 
background-color: transparent; 
color: white; 
margin: auto; 
width: 90%; 

}

たぶんこの記事はあなたを助けることができます。W3CSchools | CSS Margin

関連する問題