html - 如何使用 CSS 使 HTML 元素出现在垂直线上?

标签 html css

问题图片:

enter image description here

如何使用 CSS 从左侧转到右侧?

最佳答案

您可以使用表格:

<table>
    <tr>
        <td>You own</td>
        <td>20</td>
    </tr>
    <tr>
        <td>Price</td>
        <td>20</td>
   </tr>
    <tr>
        <td>BPS</td>
        <td>0.50</td>
   </tr>
</table>

或 float div:

<div style="display:inline-block;">
    <div style="float:left; width:150px;">You own</div>
    <div style="float:left;">20</div>
</div>

<div style="display:inline-block;">
    <div style="float:left; width:150px;">Price</div>
    <div style="float:left;">20</div>
</div>

<div style="display:inline-block;">
    <div style="float:left; width:150px;">BPS</div>
    <div style="float:left;">0.50</div>
</div>

关于html - 如何使用 CSS 使 HTML 元素出现在垂直线上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27734340/

相关文章:

css - 如何在 SCSS 中显示/隐藏同级跨度?

html - 使用 flexbox 定位固定 div

javascript - 你如何使用 jQuery 使元素交替颜色?

html - FF 上的位置问题,但 Chrome/IE8+ 上没有

html - 如何让 block 级元素粘在 div 的底部(它本身是绝对定位的)?

html - 将鼠标悬停在元素上时移动其他元素

css - parent 有未指定的高度,我怎样才能让 child 继承?

c# - 在 Web 服务器中,CSS 和 JS 引用是未知的

javascript - 在 gallery.php 中单击时突出显示缩略图

html - 两个图像链接之间的下划线