你怎么回事小老弟儿 2017-10-23 09:17 采纳率: 50%
浏览 839
已采纳

标签字太多将图片向上顶,求解决

 <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>简单的文件树效果</title>
<meta content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery.min.js"></script>
<style type="text/css">
  .mould{
    width: 120px;
    height: 160px;
    display: inline-block;
    margin:0px 10px 30px 10px;
    font-size: 12px;
    text-align: center;
  }
  .mould img{
    border: 1px solid black;
  }
  .mould span{

  }
</style>
</head>
<body>
  <div>
    <div id="list">
       <div class="mould">
        <img height="120" width="120" src="folder.png">
        <input type="checkbox">
        <span>大法师打发打发是打发打萨达</span>
       </div>
       <div class="mould">
        <img height="120" width="120" src="folder.png">
        <input type="checkbox">
        <span>大法师</span>
       </div>
    </div>
  </div>
</body>
</html>

需求:打开页面会看见,两个图片不在一个水平线上,原因为下面的span标签字体过多导致将图片向上顶,这里面标签可以随便换,样式随便写,只要能满足两个图片平齐就好

  • 写回答

4条回答 默认 最新

  • 子幽 2017-10-23 09:38
    关注
     将display: inline-block;换成float:left
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题