首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >根据旁边的文本Div调整Image div的大小

根据旁边的文本Div调整Image div的大小
EN

Stack Overflow用户
提问于 2016-06-12 13:46:47
回答 2查看 51关注 0票数 0

我有设计,这需要和图像和文本相互对齐在div(使用column 6)我需要高度图像来调整大小wrt文本div.on平板电脑和移动它有12列布局

这是我的html代码

代码语言:javascript
运行
复制
<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。

代码语言:javascript
运行
复制
.fixed-height{
    height: 300px;
    overflow-y: hidden;
}

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

小小的帮助是非常感谢的。提前感谢

EN

回答 2

Stack Overflow用户

发布于 2016-06-12 14:08:20

这应该是可行的: HTML

代码语言:javascript
运行
复制
<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

代码语言:javascript
运行
复制
.img-head{
  float: left;
}
票数 0
EN

Stack Overflow用户

发布于 2016-06-12 14:17:39

加上这个,

代码语言:javascript
运行
复制
<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 -->
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37771107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档