2016-10-24 94 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