小编xen*_*ity的帖子

Bootstrap:仅在较大的屏幕中显示固定页脚?

我现在是Bootstrap(3.3.4)的新手,我似乎对我的发布网站的页脚位置有问题.我只希望将页脚固定在较大的屏幕(平板电脑和计算机)上,而不是移动设备.

由于Bootstrap现在是移动优先的,我没有在我的css代码中明确声明我的页脚的位置样式(因为我不想修复它),除了我更大的屏幕媒体查询:

/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */

/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) {

  /* Pull out the header and footer */
  .mastfoot {
    position: fixed;
    bottom: 0;
  }

}

/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) {

  /* Pull out the header and footer */
  .mastfoot {
    position: fixed;
    bottom: 0;
  }
}

/* …
Run Code Online (Sandbox Code Playgroud)

html css less twitter-bootstrap css-preprocessor

3
推荐指数
1
解决办法
1762
查看次数

标签 统计

css ×1

css-preprocessor ×1

html ×1

less ×1

twitter-bootstrap ×1