【问题标题】:prevent bootstrap affix moving div to left防止引导词缀将 div 向左移动
【发布时间】:2013-01-27 00:54:26
【问题描述】:

在我使用 affix 属性后,我试图阻止我的右侧 div 向左移动。

请知道我是怎么做的。您可以在这里看到问题,请向下滚动:-

http://monkeygetnews.jonathanlyon.com/bs.html

谢谢

乔纳森

【问题讨论】:

标签: css twitter-bootstrap


【解决方案1】:

激活后,scroll spy 会将类 affix 和 position: fixed 添加到它正在监视的 div 中。这种定位使 div 脱离正常流动,结果是它向左浮动。

解决方案是添加一些 CSS 样式以将其浮动到您想要的位置。在你的页面中,我认为它会是这样的:

.span3.affix{
position: fixed; /* to stop the div from scrolling */
top: 0;          /* to fix the div at the top its containing element */
right: 0;        /* to fix the div at the right of its containing element */
}

您可能需要稍微尝试一下才能将其放置在您想要的位置。重要的是,一旦您知道选择器(在这种情况下)是 .span3.affix,它就很容易使用。

祝你好运!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-22
    • 1970-01-01
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 2011-07-16
    • 2017-02-09
    相关资源
    最近更新 更多