首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >把图片放在flexbox上?

把图片放在flexbox上?
EN

Stack Overflow用户
提问于 2018-04-06 03:28:17
回答 4查看 16关注 0票数 0

我试着把这些圆形图像放在我的flexboxes上,就像这样:here

我无法让图像向上移动,我尝试添加边距-底部,但图像停留在flexboxes内部。这就是我现在的样子:here

如果有人能帮我,我会很高兴的。提前谢谢。

代码语言:javascript
复制
.contact-flex {
    display: flex;
    justify-content: center;
    width: 100%;
}

.boxes, logos {
    width: 22.92vw;
    background: #e6e6e6;
    border-radius: 1.18vw;
    margin: 2.52vw;
    text-align: center;
}

.logos {
    margin-bottom: -50px;
}

.info {
    text-align: center;
    font-size: 1.26vw;
}
代码语言:javascript
复制
<div class="contact-flex">
    <div class="boxes">
        <div class="logos">
            <img src="Contacts/phone-01.png" width="80px">
        </div>
    <div class="info">
    <br><p><b>Call Us</b><br><br>
        Te: <b>519-725-7625</b></p>
    </div>
    
    </div>
    
<div class="boxes">
    <div class="logos">
        <img src="Contacts/clock-01.png" width="80px">
    </div>
    <div class="info">
    <table style="width:100%">
  <tr>
  </tr>
  <tr>
    <th>Monday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Tuesday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Wednesday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Thursday</th>
    <td>10am - 8pm</td>
  </tr>
  <tr>
    <th>Friday</th>
    <td>10am - 8pm</td>
  </tr>
  <tr>
    <th>Saturday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Sunday</th>
    <td>12pm - 5pm</td>
  </tr>
    </table>
    </div>
</div>
    
<div class="boxes">
    <div class="logos">
        <img src="Contacts/location-01.png" width="80px">
    </div>
    <div class="info">
       <p><br>The Shops<br>
        At Waterloo Town Square<br>
        75 King St. S,<br>
        Waterloo, Ontario, Canada</p> 
    </div>
</div>
</div>

EN

Stack Overflow用户

发布于 2018-04-06 03:40:08

这里有一个解决方案:

代码语言:javascript
复制
.contact-flex {
    display: flex;
    justify-content: center;
    width: 100%;
    height:300px;
  box-sizing:border-box;
  padding-top:20px;
}

.boxes, logos {
    width: 22.92vw;
    background: #e6e6e6;
    border-radius: 1.18vw;
    margin: 2.52vw;
    text-align: center;
}

.logos {
    margin-top: -30px;
}

.info {
    text-align: center;
    font-size: 1.26vw;
}
代码语言:javascript
复制
<div class="contact-flex">
    <div class="boxes">
        <div class="logos">
          <img src="http://via.placeholder.com/75x75" style="border-radius:50%;">
        </div>
    <div class="info">
    <br><p><b>Call Us</b><br><br>
        Te: <b>519-725-7625</b></p>
    </div>
    
    </div>
    
<div class="boxes">
    <div class="logos">
        <img src="http://via.placeholder.com/75x75" style="border-radius:50%;">
    </div>
    <div class="info">
    <table style="width:100%">
  <tr>
  </tr>
  <tr>
    <th>Monday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Tuesday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Wednesday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Thursday</th>
    <td>10am - 8pm</td>
  </tr>
  <tr>
    <th>Friday</th>
    <td>10am - 8pm</td>
  </tr>
  <tr>
    <th>Saturday</th>
    <td>10am - 6pm</td>
  </tr>
  <tr>
    <th>Sunday</th>
    <td>12pm - 5pm</td>
  </tr>
    </table>
    </div>
</div>
    
<div class="boxes">
    <div class="logos">
        <img src="http://via.placeholder.com/75x75" style="border-radius:50%;">
    </div>
    <div class="info">
       <p><br>The Shops<br>
        At Waterloo Town Square<br>
        75 King St. S,<br>
        Waterloo, Ontario, Canada</p> 
    </div>
</div>
</div>

票数 0
EN
查看全部 4 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49680089

复制
相关文章

相似问题

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