我怎样才能获得如附图所示的布局?

发布于 2024-12-03 16:40:30 字数 1486 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

撩发小公举 2024-12-10 16:40:30

一个非常简单的哈希

http://jsfiddle.net/H5BVs/

应该为您指明正确的方向: )

A very simple hash of it

http://jsfiddle.net/H5BVs/

Shoudl point you in the right direction :)

浪漫之都 2024-12-10 16:40:30

这应该可以帮助您开始

HTML

<div id="followers"><span>3</span>followers</div>
<div id="following"><span>3</span>following</div>
<div id="props"><span>2</span>props</div>

CSS

#followers, #following, #props{
    display:inline-block;
    height:50px;
    width:100px;
    border-right:1px solid #c2c2c2;
    text-align:center;
}

#props{
    border:none;
}

#followers span, #following span, #props span{
    font-size:1.8em;
    display:block;
}

示例: http://jsfiddle.net/PxDMA/

This should get you started

HTML

<div id="followers"><span>3</span>followers</div>
<div id="following"><span>3</span>following</div>
<div id="props"><span>2</span>props</div>

CSS

#followers, #following, #props{
    display:inline-block;
    height:50px;
    width:100px;
    border-right:1px solid #c2c2c2;
    text-align:center;
}

#props{
    border:none;
}

#followers span, #following span, #props span{
    font-size:1.8em;
    display:block;
}

Example: http://jsfiddle.net/PxDMa/

往日 2024-12-10 16:40:30

在这里您可以查看一个工作示例: http://jsfiddle.net/2LxxT/

HTML

<ul>
    <li>
        <span>3</span>
        followers
    </li>
    <li class="padded">
        <span>6</span>
        following
    </li>
    <li>
        <span>2</span>
        props
    </li>
</ul>

CSS

ul
{ font-family: arial; }

/* LI's have a default display of block, setting a float will display them on the same line, alternatively display:inline-block; would do the same */
    ul li
    {float:left;height:60px; font-size: 12px; color: #A19AA2; }

/* Target the very first list element */
    ul li:first-child
    { padding-right: 20px; }

/* Target the very last list element */
    ul li:last-child
    { padding-left: 20px; }

/* Add padding to your middle element */
    ul li.padded
    { border-left: 1px solid #E8E8E8; border-right: 1px solid #E8E8E8; padding:0 20px; }

/* Change your span from an inline element to a block element */
    ul li span
    { display: block; font-size: 20px; color: #434343; font-weight: bold; margin-top: 12px;}

here you can view a working example: http://jsfiddle.net/2LxxT/

HTML

<ul>
    <li>
        <span>3</span>
        followers
    </li>
    <li class="padded">
        <span>6</span>
        following
    </li>
    <li>
        <span>2</span>
        props
    </li>
</ul>

CSS

ul
{ font-family: arial; }

/* LI's have a default display of block, setting a float will display them on the same line, alternatively display:inline-block; would do the same */
    ul li
    {float:left;height:60px; font-size: 12px; color: #A19AA2; }

/* Target the very first list element */
    ul li:first-child
    { padding-right: 20px; }

/* Target the very last list element */
    ul li:last-child
    { padding-left: 20px; }

/* Add padding to your middle element */
    ul li.padded
    { border-left: 1px solid #E8E8E8; border-right: 1px solid #E8E8E8; padding:0 20px; }

/* Change your span from an inline element to a block element */
    ul li span
    { display: block; font-size: 20px; color: #434343; font-weight: bold; margin-top: 12px;}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文