css - 在 bootstrap 中定位 div

标签 css html twitter-bootstrap

想知道为什么定位 div 以保持响应如此困难.. 它们出于某种原因只是 float 在他们想要的地方.. 我怎样才能完美地定位它们?在像我的社交图标一样调整大小时保持他们的位置http://www.closetvip.com/splash.html

/* Menu Buttons */
#english {
    float:right;
    position:absolute;
    right:570px;
    bottom:101px;
    clear:right;

}
#spanish {
    position:absolute;
    left:570px;
    bottom:100px;
    clear:right;

}


<div id="spanish">
    <img src="img/espanol.png">
</div>
<div id="english">
    <img src="img/english.png">
</div>

最佳答案

您需要在绝对 div 的父 div 上使用 position: relative; 否则元素是窗口的绝对值

关于css - 在 bootstrap 中定位 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17628235/

相关文章:

html - 将 CSS 和占位符文本应用于 Rails 登录表单

html - 将 Logo 和链接放在标题中的同一行

html - Accordion 类内的卡片元素不是水平定位的 BOOTSTRAP 4

java - 如何用 Jsoup 捕捉这段文字?

html - 不知道如何使导航栏居中

jquery - 嵌套的 Li 元素悬停备用背景颜色

html - 子项与父项大小相同,但出现滚动

html - 无法使 Bootstrap 标签变高

css - Bootstrap 4 : hide medium only

jquery - Twitter Bootstrap 复选框按钮值在单击事件后发生更改