2016-06-12 78 views
0

我有设计需要和图像和文本对齐在div(使用col-md-6)彼此相邻我需要调整大小的高度图像文本div.on片剂和移动它是12列布局Resize Image Div尊重文本div旁边它

这里是我的html代码

<div class="row fixed-height"> 
        <div class="col-md-6 full-screen-col img-head"></div><!--col for imag row ends here--> 
        <div class="col-md-6 cont-bg full-screen-col"> 
        <div class="description_container"> 
         <h1>JOIN OUR TEAM</h1> 
         <p>We except a lot from our team members, and we give a lot in return- like ongoing training, professional growth 
         opportunities and competitive benefits. if Gaspar's sounds like your kind of workplace, we'd love to hear from you</p> 
        </div> 
        </div><!--container for text details--> 
       </div><!--row fors slide container --> 

这里使用的CSS。

.fixed-height{ 
    height: 300px; 
    overflow-y: hidden; 
} 

.img-head{ 
    background-image: url(../images/Gaspars-Construction-Employee-Photo-1024x683.jpg); 
    background-size: cover; 
    height: 100%; 
} 

小小的帮助非常感谢。在此先感谢

+0

使用SM移动设备。 – frnt

回答

0

这应该工作: HTML

<div class="row fixed-height"> 
    <div class="col-md-6 full-screen-col img-head"> 
      <img src="https://dncache-mauganscorp.netdna-ssl.com/thumbseg/308/308116-bigthumbnail.jpg"/> 
    </div><!--col for imag row ends here--> 
    <div class="col-md-6 cont-bg full-screen-col"> 
      <div class="description_container"> 
       <h1>JOIN OUR TEAM</h1> 
       <p>We except a lot from our team members, and we give a lot in return- like ongoing training, professional growth opportunities and competitive benefits. if Gaspar's sounds like your kind of workplace, we'd love to hear from you</p> 
      </div> 
    </div><!--container for text details--> 
</div><!--row fors slide container --> 

CSS

.img-head{ 
    float: left; 
} 
+0

当您调整大小时,手机和平板电脑图像不可见 – Sandy

+0

与col-md-6类似,在引导程序中有一个移动类名称。检查出来,并使用它应该工作。 – denis

+0

当我添加sm-12图像不可见 – Sandy

0

添加这个,

<div class="row fixed-height"> 
       <div class="col-md-6 col-sm-6 full-screen-col img-head"></div><!--col for imag row ends here--> 
       <div class="col-md-6 col-sm-6 cont-bg full-screen-col"> 
       <div class="description_container"> 
        <h1>JOIN OUR TEAM</h1> 
        <p>We except a lot from our team members, and we give a lot in return- like ongoing training, professional growth 
        opportunities and competitive benefits. if Gaspar's sounds like your kind of workplace, we'd love to hear from you</p> 
       </div> 
       </div><!--container for text details--> 
      </div><!--row fors slide container -->