html - 如何获取图片下方的文字?

标签 html css

wallet

正如您在上面看到的,这就是我目前拥有的。我希望文本在每个图标下方居中。

这是 HTML:

<div class="wallet-actions-section">
  <div class="container">
    <div class="row">
      <div class="col-md-11 col-sm-12">
        <div class="wallet-action-col">
          <a href="~/Views/Account/Login.cshtml"><img src="~/assets/images/icons/send-icon.png" /></a>Send or Request
          <a href="~/Views/Account/Login.cshtml"><img src="~/assets/images/icons/add-money-icon.png" /></a>Send or Request
          <a href="~/Views/Account/Login.cshtml"><img src="~/assets/images/icons/withdraw-icon.png" /></a>Send or Request
          <a href="~/Views/Account/Login.cshtml"><img src="~/assets/images/icons/security-icon.png" /></a>Send or Request
          <a href="~/Views/Account/Login.cshtml"><img src="~/assets/images/icons/exchange-icon.png" /></a>Send or Request
        </div>
      </div>
   </div>
 </div>

这是CSS:

 .wallet-action-col {
   height: 100px;
   width: 90%;
   margin:0 auto;
   border-radius: 5px;
   padding: 15px;
   background-color: #f3f8fb;
   color: #262626;
 }

.wallet-actions-section {
  margin-top:10px;
  margin-bottom:10px;   
}

最佳答案

您可以添加 <br>将文本分到下一行。然后创建一个新的 divclass="wallet-action-box" 包围每个“盒子”以一切为中心。

 .wallet-action-box {
   display:inline-table;
   border:1px solid #aaa;
   text-align:center
 }

Try this fiddle

关于html - 如何获取图片下方的文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38861051/

相关文章:

html - 如何使用 css 将 <a href ="#"></a> 转换为 <%= link_to %>?

html - 如何预设保存 html 页面的文件名?

jQuery 验证多个输入 :file

css - 文本溢出 :ellipsis; Can't get to work

css - 如何在传单中设置路径样式?

html - 使用 animate.css 创建效果预览

html - 知道如何在 css 中执行此操作吗?

html - Rails - 使用一个提交按钮提交多个表单

javascript - 填充两个 DIV 元素之间的空白区域

javascript - 代码未打印到屏幕