css – 我们正在使用来自twitter bootstrap的一些代码,我们的div在Internet Explorer中关闭(7-9)

前端之家收集整理的这篇文章主要介绍了css – 我们正在使用来自twitter bootstrap的一些代码,我们的div在Internet Explorer中关闭(7-9)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们使用的代码来自与定位相关的较少文件.该网站在safari,firefox和chrome中看起来很棒,并且在IE 7,8和9版本中看起来很好.引导程序是否存在IE的已知问题?可能不是因为它如此广泛使用.但我无法确定哪里出错了.顺便说一下,这里有两个带有Internet Explorer中可视错误的示例页面http://www.presspass.me和一个更简单的页面http://www.presspass.me/about或者您可以查看截图.

我的猜测是它很小,任何帮助都会受到赞赏!@H_301_3@

/*
 * Scaffolding
 * Basic and global styles for generating a grid system,structural layout,and page templates
 * ------------------------------------------------------------------------------------------- */

// Variables
// Can also be 24 / 20 / 20
// Or 16 / 40 /20
@gridColumns:       24;
@gridColumnWidth:   20px;
@gridGutterWidth:   20px;
@extraSpace:        (@gridGutterWidth * 2); // For our grid calculations
@siteWidth:         (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));


// Mixins
// Clearfix for clearing floats like a boss h5bp.com/q

.clearfix() {
  zoom: 1;
  &:before,&:after {
    display: table;
    content: "";
    zoom: 1;
  }
  &:after {
    clear: both;
  }
}

// Center-align a block level element
.center-block() {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.fixed-container() {
  width: @siteWidth;
  margin-left: auto;
  margin-right: auto;
  .clearfix();
}

.columns(@columnSpan: 1) {
  width: (@gridColumnWidth * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1));
}

.offset(@columnOffset: 1) {
  margin-left: (@gridColumnWidth * @columnOffset) + (@gridGutterWidth * (@columnOffset - 1)) + @extraSpace;
}

// Necessary grid styles for every column to make them appear next to each other horizontally
.gridColumn() {
  display: inline;
  float: left;
  margin-left: @gridGutterWidth;
}

// makeColumn can be used to mark any element (e.g.,.content-primary) as a column without changing markup to .span something
.makeColumn(@columnSpan: 1) {
  .gridColumn();
  .columns(@columnSpan);
}


// STRUCTURAL LAYOUT
// -----------------
/*
body {
  margin: 0;
}
*/
// Container (centered,fixed-width layouts)
.container {
  .fixed-container();
}

// Fluid layouts (left aligned,with sidebar,min- & max-width content)
.container-fluid {
  position: relative;
  min-width: 940px;
  padding-left: 20px;
  padding-right: 20px;
  .clearfix();
  > .sidebar {
    position: absolute;
    top: 0;
    left: 20px;
    width: 220px;
  }
  // TODO in v2: rename this and .popover .content to be more specific
  > .content {
    margin-left: 240px;
  }
}


// BASE STYLES
// -----------

// Quick floats
.pull-right {
  float: right;
}
.pull-left {
  float: left;
}

// Toggling content
.hide {
  display: none;
}
.show {
  display: block;
}


// GRID SYSTEM
// -----------
// To customize the grid system,bring up the variables.less file and change the column count,size,and gutter there

.row {
  .clearfix();
  margin-left: -@gridGutterWidth;
}

// Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7)
// Credit to @dhg for the idea
.row > [class*="span"] {
  .gridColumn();
}

// Default columns
.span1     { .columns(1); }
.span2     { .columns(2); }
.span3     { .columns(3); }
.span4     { .columns(4); }
.span5     { .columns(5); }
.span6     { .columns(6); }
.span7     { .columns(7); }
.span8     { .columns(8); }
.span9     { .columns(9); }
.span10    { .columns(10); }
.span11    { .columns(11); }
.span12    { .columns(12); }
.span13    { .columns(13); }
.span14    { .columns(14); }
.span15    { .columns(15); }
.span16    { .columns(16); }

// For optional 24-column grid
.span17    { .columns(17); }
.span18    { .columns(18); }
.span19    { .columns(19); }
.span20    { .columns(20); }
.span21    { .columns(21); }
.span22    { .columns(22); }
.span23    { .columns(23); }
.span24    { .columns(24); }

// Offset column options
.row {
  > .offset1   { .offset(1); }
  > .offset2   { .offset(2); }
  > .offset3   { .offset(3); }
  > .offset4   { .offset(4); }
  > .offset5   { .offset(5); }
  > .offset6   { .offset(6); }
  > .offset7   { .offset(7); }
  > .offset8   { .offset(8); }
  > .offset9   { .offset(9); }
  > .offset10  { .offset(10); }
  > .offset11  { .offset(11); }
  > .offset12  { .offset(12); }
}

// Unique column sizes for 16-column grid
.span-one-third     { width: 300px; }
.span-two-thirds    { width: 620px; }
.row {
  > .offset-one-third   { margin-left: 340px; }
  > .offset-two-thirds  { margin-left: 660px; }

解决方法

My guess is that it’s something small,any help would be appreciated!@H_301_3@

这是小事.@H_301_3@

你错过了一个doctype.添加为第一行:@H_301_3@

<!DOCTYPE html>

如果没有有效的doctype,您的页面显示quirks mode中.@H_301_3@

打开开发人员工具(按F12)以查看实际使用的模式.@H_301_3@

原文链接:https://www.f2er.com/css/215519.html

猜你在找的CSS相关文章