'Aw, Snap!' Error when inspecting element in Chrome

后端 未结 2 871
陌清茗
陌清茗 2021-02-08 00:04

Whenever I inspect any element that\'s part of my navigation menu, OR inspect element and then browse to a navigation menu I get the \'Aw, Snap\' error in Google Chrome. I figur

2条回答
  •  温柔的废话
    2021-02-08 00:38

    The problem appears to be an issue with your style.css file. In that file, you have:

    /*::selection {
        background: #666; /* Safari */
        color: #FFF;
    }
    
    ::-moz-selection {
        background: #666; /* Firefox */
        color: #FFF;
    }*/
    

    What's happening is you have a comment /* Safari */ within a broader comment around the entire snippet above, which is closing the broader comment prematurely and causing a parse error for the CSS. Google Chrome is choking on the malformed CSS file, which is causing the "Aw, snap!" error to occur when inspecting elements.

    Removing the /* Safari */ comment won't fix that problem, as the /* Firefox */ below it causes the same issue.

    EDIT: While that did fix a minor issue with the CSS, it wasn't the whole solution. In light of thakis' answer below, fixing the following style does prevent the crashing when inspecting elements:

    #navigation-menu-container{
      border-image:  url(images/shadow-border.png) 10 stretch;
    }
    

    Compare this fiddle, which is a copy/paste of the site code in question (all head tags and relevant html markup), with the corrected fiddle, in which the style.css markup has been imported into the fiddle and the #navigation-menu-container rule has been changed to the above code, and you'll see that the fiddle page doesn't crash.

提交回复
热议问题