2016-06-12 79 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 -->