css - Twitter Bootstrap float 响应容器

标签 css twitter-bootstrap css-float

我需要为平板电脑 View float 一个 .container,那么我如何才能在我的媒体查询中反转这个明显的 float hack?这样.container就可以 float 了

.container {
  margin-right: auto;
  margin-left: auto;
  *zoom: 1;
}

.container:before,
.container:after {
  display: table;
  line-height: 0;
  content: "";
}

.container:after {
  clear: both;
}

最佳答案

我想我理解了这个问题,所以要撤销您在媒体查询中所做的更改,请使用下面的 CSS 将其设置回初始值。

.container {
  margin-right: initial;
  margin-left: initial;
  *zoom: initial;
}

.container:before,
.container:after {
  display: table;
  line-height: initial;
  content: initial;
}

.container:after {
  clear: initial;
}

关于css - Twitter Bootstrap float 响应容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15614264/

相关文章:

html - 如何设置 float div相对于邻居的宽度

jquery - 滚动过去后固定一个 div

javascript - CSS Transition 在样式更改的相反方向上不起作用?

html - :before causes elements to be unselectable

javascript - 如何在外部 JS 脚本运行完成后运行函数

html - 我的侧边栏不在我页面的右侧,而是在我的左侧。我该如何解决?

google-chrome - 外部样式表中定义的 CSS 过渡会导致页面加载时发生过渡

c# - 防止在 ASP.NET 中回发时关闭 Bootstrap 模式

css - 绝对定位 Div 之上的 float Div

html - CSS:100% div 在移动设备上未显示为 100%