Chrome Web Developer 工具,实时 CSS 编辑不起作用,重置为默认值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12878279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Chrome Web Developer tools, live CSS editing won't work, resets to default
提问by andymcgregor
Got strange Chrome Web Developer tools behavior. When I try to change existing CSS properties of element, after hitting enter, it's resets to previous default state. Earlier, all works well. Has disabled all extensions, nothing changes. What is this? p.s Chrome version 22.0.1229.94m
有奇怪的 Chrome Web Developer 工具行为。当我尝试更改元素的现有 CSS 属性时,按 Enter 键后,它会重置为以前的默认状态。早些时候,一切正常。已禁用所有扩展,没有任何变化。这是什么?ps Chrome 版本 22.0.1229.94m
采纳答案by Alexander Pavlov
http://code.google.com/p/chromium/issues/detail?id=155795has been fixed in the tip of tree, and the fix will eventually propagate into Chrome 23 (current beta) and Chrome 22 (current stable). Sorry about it, and thanks for your patience.
http://code.google.com/p/chromium/issues/detail?id=155795已在树的顶端修复,该修复最终将传播到 Chrome 23(当前测试版)和 Chrome 22(当前稳定版) . 抱歉,感谢您的耐心等待。
In any case, check your stylesheets for errors, since this kind of issues happens only while editing broken stylesheets. http://jigsaw.w3.org/css-validator/is a good tool to use (pay attention to the "Parse error" errors.)
在任何情况下,请检查您的样式表是否有错误,因为此类问题仅在编辑损坏的样式表时才会发生。http://jigsaw.w3.org/css-validator/是一个很好用的工具(注意“解析错误”错误。)
回答by Luke H
I'm not sure if this is the same problem, but I found this failed to work when the AdBlock Plus extension was active..
我不确定这是否是同样的问题,但我发现当 AdBlock Plus 扩展处于活动状态时这无法正常工作..
This might be the bug, but I can't remember for sure.
https://code.google.com/p/chromium/issues/detail?id=138854&can=1&q=adblock%20cr%3DPlatform-DevTools&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20Modified
I found that simply clicking the ABP icon and disabling it for the site in question restored functionality.
我发现只需单击 ABP 图标并为相关站点禁用它即可恢复功能。
回答by user2772325
A Chrome bug with @viewport was the cause for me: https://code.google.com/p/chromium/issues/detail?id=278289
@viewport 的 Chrome 错误是我的原因:https: //code.google.com/p/chromium/issues/detail?id=278289
回答by Fateh Khalsa
Definitely check your stylesheet for errors - it may not even be anything that is obvious or that a CSS checker will find.
一定要检查你的样式表是否有错误——它甚至可能不是任何明显的或 CSS 检查器会发现的。
In my case the offending styles were some input element pseudo-selectors, for styling the placeholder text. Removed the lines, and it works perfectly again!
在我的例子中,有问题的样式是一些输入元素伪选择器,用于设置占位符文本的样式。删除了线条,它再次完美运行!
Edit:The error in my case seems to be caused more specifically by placing any of the non -webkit prefixedinput-placeholder pseudoselectors inside of a media query. Go figure...
编辑:在我的情况下,错误似乎是通过将任何非 webkit 前缀的输入占位符伪选择器放置在媒体查询中而引起的。去搞清楚...
Now on to figuring out why that's a problem...
现在要弄清楚为什么这是一个问题......
回答by Taiger
This is what worked for me.
这对我有用。
Under Chrome Developer Tools > Settings > General Tab, check the option:
在 Chrome 开发者工具 > 设置 > 常规选项卡下,选中该选项:
Disable cache (while DevTools is open)
禁用缓存(当 DevTools 打开时)
回答by gamliela
Restart Chrome and try again... You can also try reloading the page in a new tab.
重新启动 Chrome 并重试...您也可以尝试在新标签页中重新加载页面。
It's probably a Chrome bug. It happens to me when I apply style to element with jQuery css()
command, but I guess it can happen in many other scenarios as well.
这可能是 Chrome 的错误。当我使用 jQuerycss()
命令将样式应用于元素时,它会发生在我身上,但我想它也可能发生在许多其他场景中。
回答by Ishan Madhusanka
I had the same issue. After you make sure the file names are correct, removing the folder from the workspace, and adding it againenabled live editing to work as usual again on chrome for local files.
我遇到过同样的问题。确保文件名正确后,从工作区中删除文件夹,并再次添加它,使实时编辑能够在 chrome 上为本地文件再次照常工作。
回答by ckdesign
I have this issue on a site and I narrowed it down to a missing background resource.
我在一个网站上遇到了这个问题,我将其范围缩小到缺少背景资源。
I have switched to using FireFox for live CSS editing, never had a problem with the FireBug extension.
我已经改用 FireFox 进行实时 CSS 编辑,FireBug 扩展从来没有出现过问题。