发布于 1970-01-01 08:00
  • 1 个回答
    • 对我来说,最好的解决方案是使用display: table技术(我在上一个问题中回答):

      #playerlist {
        display: table;
        width: 100%;
      }
      .opponents_list {
        height: 3em;
        margin: 0.1em auto;
        background: #666;
        vertical-align: middle;
        display: table-row;
      }
      .opponent_list_bold_name {
        vertical-align: middle;
        display: table-cell;
        width: 100%;
      }
      .tableCell {
        display: table-cell;
        vertical-align: middle;
      }
      <div class="opponents_list"><b class="opponent_list_bold_name">bob</b>
      
        <div class="tableCell">
          <button class="opponent_list_button" type="button">Invite</button>
        </div>
      </div>
      <div class="opponents_list"><b class="opponent_list_bold_name">harri</b>
      
        <div class="tableCell">
          <button class="opponent_list_button" type="button">Invite</button>
        </div>
      </div>
      <div class="opponents_list"><b class="opponent_list_bold_name">harri2</b>
      
        <div class="tableCell">
          <button class="opponent_list_button" type="button">Invite</button>
        </div>
      </div>
      <div class="opponents_list"><b class="opponent_list_bold_name">kaleeem</b>
      
        <div class="tableCell">
          <button class="opponent_list_button" type="button">Invite</button>
        </div>
      </div>
      <div class="opponents_list"><b class="opponent_list_bold_name">nehaaa</b>
      
        <div class="tableCell">
          <button class="opponent_list_button" type="button">Invite</button>
        </div>
      </div>
      2022-12-11 02:05 回答
    撰写答案
    PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
    Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有