2016-10-24 97 views
1

我使用引導4阿爾法5和我有以下HTML:自舉行不對齊

<div class="home-content"> 
    <div class="container"> 
     <div class="row flex-items-xs-middle"> 
      <div class="col-md-7"> 
       <h1 class="site-title text-xs-center text-md-left"> 
        <span class="name">I'm Shivam Paw</span> 
        <span class="title">I create beautiful and bespoke websites to fit your needs</span> 
       </h1> 
      </div> 
      <div class="col-md-5"> 
       <img src="https://www.shivampaw.com/wp-content/uploads/2016/10/shivampaw.png" class="float-md-right img-fluid logo-me mx-auto" alt="Shivam Paw"> 
      </div> 
     </div> 
    </div> 
</div> 

但是,如果你看到下面那麼圖像,你會看到,內容是錯位到左邊。我在SO上看到過這篇文章,但它說你必須把行類放在我已經完成的容器中。

您可以看到網站住在https://www.shivampaw.com

Misaligned Row

我看着它具有保證金左,-15px的權利.row CSS。消除這些利潤率固定它,但我不認爲這應該是怎麼回事?

+0

您是否在排班中詢問Marging?是的,bootstrap添加了它。也依賴於容器流體和容器。 。 。學會使用容器類。 – ccdiego5

+0

@ ccdiego5你讀過我的問題嗎?...... – Shiv

+0

很奇怪的行爲。它看起來像'margin-right:-15px;'對你的行沒有影響 – mizurnix

回答

0

原來我有一些問題的CSS在我的style.css :

*, img.full-size{ 
    max-width: 100%; 
} 

將其更改爲:

img.full-size{ 
    max-width: 100%; 
} 

解決了這一問題。

0

enter image description here如果這是你所期望的,那麼看看你的CSS。這是該行圍繞您的內容

.text-xs-center { 
 
    text-align: center!important; 
 
}

這應該修復它雖然

.site-title { 
 
    font-size: 36px; 
 
    color: white; 
 
    font-weight: bold; 
 
    text-align: left !important; 
 
}

+0

不,我希望文本居中。仔細看看這個位置,它沒有正確居中。 – Shiv