简体   繁体   English

Chrome正在打破flexbox,而Firefox却没有

[英]Chrome is breaking flexbox while Firefox doesn't

I've got a problem with Chrome breaking flexbox CSS in the front page of a website, while FF doesn't. Chrome在网站首页上破坏flexbox CSS时出现问题,而FF没有。 Here is the HTML 这是HTML

    <div class="intro_container">
    <div id="top_text1" class = "intro_items intro_item_1">
    ....
    </div>
    <div id="top_text2" class = "intro_items intro_item_1">
    ....
    </div>
    </div>

and the CSS 和CSS

    div.intro_container  {
      width: 100%;
      background:;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
    }
    div.intro_items  {
      background: white;
      border:  .1em solid #000093;
      margin: 0.5em;
      padding: 3%;
      flex:  1 0 40%;
    }

Any help would be most welcome 任何帮助将是最欢迎的

From my point of view, the problem is not with the browsers or flex property issues. 从我的角度来看,问题不在于浏览器或flex属性问题。

The problem is with the following CSS style, 问题在于以下CSS样式,

             div#top_text1 {margin-top: -3%;} 

line no:325 in layout.css file 在layout.css文件中的行号:325

So just remove this CSS style add check out it will work.... 因此,只需删除此CSS样式,然后添加它即可。...

I'm getting a similar issue... I have a page that is OK in IE, Firefox, Opera and Safari... but DIV width is "broken" now in Chrome... just in the last week or so. 我遇到了类似的问题...我的页面在IE,Firefox,Opera和Safari中都可以正常运行...但是在Chrome中,DIV宽度现在“被破坏”了……就在最后一周左右。

Checking in Firebug ( etc) I have to set a certain DIV one pixel larger than normal, else the picture inside gets "squeezed out". 检入Firebug(等)时,我必须将某个DIV设置为比普通像素大一个像素,否则里面的图片会被“挤出”。

Can't get to my server til tomorrow to actually edit Anything but 'inspect element' shows that is a workaround. 直到明天我都无法到达服务器来实际编辑任何内容,但“检查元素”显示这是一种解决方法。 Not sure WHY the problem has reared its ugly head, exactly - the page has been working great for more than a year now :-( 不确定为什么问题会抬起头来,确切来说-该页面已经运行了一年多了:-(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM