因此,在经过几次自举之后,决定尝试将其与 wordpress 混合使用。那里有一大堆问题,但我现在主要关心的是,为什么 angies 列表图像不向右移动?我在 css 中做了 float:right,我做了 pull-right class,我什至做了 margin-left:99%... 它仍然存在。为什么? 任何其他笔记也很感激:) 你可以在这里看到全部 http://soloveich.com/
<body>
<div class="container-fluid>
<div class="row-fluid" id="heady">
<div class="span4"><div id="sign"></div></div>
<div class="span4" id="menubg">
<nav class="navbar">
<div class="navbar-inner">
<?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>
</div>
</nav>
</div>
<div class="span4" class="pull-right"><div id="angies"><img src="http://www.soloveich.com/wp-content/themes/Yellow-sign/images/angies.png"></div>
<div id="lic">
<ul id="licen">
<li>Phone# (555)555-5555</li>
<li>Lic# 7778899</li>
<li>Bond# 111223344</li>
</ul>
</div>
</div>
</div>
和CSS
#heady {
background-color: #727272;
Height:370px;
}
#sign{
background-image: url(images/sign.png);
height: 334px;
width: 334px;
margin-left: 15px;
margin-top: 10px;
}
#menubg {
font-family: 'Contrail One', cursive;
font-weight: 200;
font-size: 25px;
text-decoration: none;
margin-top:130px;
}
#angies {
margin-top: 20px;
float: right;
margin-left: 99%;
}
最佳答案
如果你想让它有你的#angies
在页面的最右侧执行以下操作:
#angies{
position:absolute;
margin-top:20px;
right:0px;
}
长话短说:您将强制您的元素在距您右侧 0 像素的绝对位置处脱离流。
此外,当我使用 Chrome 中的开发人员工具浏览页面的源代码时,我意识到您没有正确嵌入 Bootstrap javascript。查看结束前的最后一个脚本标记 </body>
标签。当您包含 javascript 文件时,您忘记包含模板的路径,这在 Wordpress 中是强制性的。该行代码应如下所示:
<script src="<?php bloginfo('template_url');?>/js/bootstrap.min.js"></script>
不仅仅是这个:
<script src="js/bootstrap.min.js"></script>
关于css - WordPress Bootstrap 。不向右流动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18971858/