Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 引导图标-定位问题_Html_Css_Twitter Bootstrap_Glyphicons - Fatal编程技术网

Html 引导图标-定位问题

Html 引导图标-定位问题,html,css,twitter-bootstrap,glyphicons,Html,Css,Twitter Bootstrap,Glyphicons,我试图将引导3中的glyphicon的位置从用户名下方移动到用户名旁边,但我无法使其移动。以下是HTML代码: <div class="well sidebarbox"> <div class="avatar large pull-left"> <a href="<?php echo $this->baseUrl()?>/<?php echo $this->GetCurrentUserData('name')?>">

我试图将引导3中的glyphicon的位置从用户名下方移动到用户名旁边,但我无法使其移动。以下是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>
目前,输出如下:

Richard Evans
[glyphicon]
我希望是这样

Richard Evans [glyphicon]
如有任何建议,将不胜感激


谢谢

将用户名放在一个div中,并将所有div浮动到左侧。

很难判断您在这里做什么,我看不出您使用的是什么版本的引导,让我们假设3

文件在这里

一般来说,如果你想使用字形,你可以这样做

<span class="glyphicon glyphicon-star"></span> Username
<a href"...">Username <span class="glyphicon glyphicon-star"></span></a>
用户名
我发现,字形和文本之间的间距对于维护很重要

对于超链接,它可能如下所示

<span class="glyphicon glyphicon-star"></span> Username
<a href"...">Username <span class="glyphicon glyphicon-star"></span></a>

其实很简单


我能给你的最好建议是,在引入动态文本之前用HTML创建UI。JSFIDLE是一个很好的练习场所。

引导中的
glyphicon
类。css
保留默认位置,因为所有
'glyphicon-*'
类都有一个相关的psedo类,将图标放在前面组成部分
例如:

.glyphicon-asterisk:before { content: "\2a"; } .glyphicon-plus:before { content: "\2b"; } .glyphicon-euro:before { content: "\20ac"; }
你能把结果页面弄得乱七八糟吗?乍一看,我会说你应该把用户名放在一个div中,然后把所有div都放到左边。是的,如果你看看这个,你会看到输出的内容:www.startrekrisa.com/Picture1.pngOh干杯!我设法做到了D谢谢这是一个“请修改我的代码”类型的问题。