在Bootstrap 3中,我试图将图标的位置从用户名下面移到它旁边,但我无法让它移动。下面是HTML代码:
<div class="well sidebarbox">
<div class="avatar large pull-left">
<a href="<?php echo $this->baseUrl()?>/<?php echo $this->GetCurrentUserData('name')?>">
<img src="<?php echo $this->GetStorageUrl('avatar') . $this->GetCurrentUserData('avatar')?>">
</a>
</div>
<strong><?php echo $this->GetCurrentUserData('screen_name')?></strong>
<?php $current_user_meta = Zend_Registry::get('current_user_meta');?>
<?php if (isset($current_user_meta['badges'])):?>
<div class="network-badges horizontal">
<?php echo $this->partial('/partial/badges.phtml', array('badges' => $current_user_meta['badges']));?>
</div>
<?php endif;?>
<div class="clearfix"></div>
<hr />
<ul class="nav nav-pills nav-stacked">
<li>
<a href="<?php echo $this->baseUrl()?>/editprofile/edit"><?php echo $this->translate('Edit Profile');?></a>
</li>
<li>
<a href="<?php echo $this->baseUrl()?>/search/posts"><?php echo $this->translate('All Posts');?></a>
</li>
</ul>
</div>下面是我的CSS代码:
.network-badges.vertical{
padding-left: 1px;
}
.network-badges.horizontal{
white-space: nowrap;
}
.network-badges.vertical{
max-width: 64px;
}
.network-badges .network-badge{
margin: 3px 3px 0 3px;
cursor: pointer;
}目前,输出如下:
Richard Evans
[glyphicon]我想让它成为
Richard Evans [glyphicon]任何建议都将不胜感激。
谢谢
发布于 2014-02-17 04:59:24
很难知道你在这里做什么,我也看不出你使用的是哪个版本的bootstrap,假设是3。
文档在这里http://getbootstrap.com/components/
通常,如果你想使用字形,你可以这样做
<span class="glyphicon glyphicon-star"></span> Username我发现保持字形和文本之间的空格很重要
对于超链接,它可能如下所示
<a href"...">Username <span class="glyphicon glyphicon-star"></span></a>真的就是这么简单。
我能给你的最好的建议是在引入动态文本之前用超文本标记语言制作你的UI,jsFiddle是一个很好的练习场所。
发布于 2014-02-17 04:40:14
将用户名放在div中,并将所有div放在左边。
https://stackoverflow.com/questions/21816050
复制相似问题