如何从 Style DOM 对象获取源文件行号?
我是 JavaScript 世界的新手。如果您检查 Chrome 浏览器的开发人员工具的“元素”选项卡的右窗格,您将找到“匹配的 css 规则”部分,其中显示了源文件名,并且对于每个应用的 css 规则,显示了行号。
我的问题是,HTML DOM 的哪些对象属性可以告诉行号(和源文件名)?谢谢!
I'm new to JavaScript world. If you check in the Chrome browser's Developer tools the right pane of the Element tab, you'll find the 'Matched css rules' section, there is a source file name shown and for each applied css rule there is the line number shown.
My question is, which object properties of the HTML DOM can tell the line numbers (and the source file name) ? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读整个第一个([0])样式表...
您应该能够通过行号来提醒规则,我想虽然这完全没用,但您想要引用一个元素并找出什么规则( s) 改为应用于它。
更多信息请参见:http://www.javascriptkit.com/dhtmltutors/externalcss3.shtml
Read the entire first ([0]) style sheet...
You should be able to alert a rule by a line number I imagine though that would be utterly useless, you'd want to reference an element instead and figure out what rule(s) applied to it instead.
More here: http://www.javascriptkit.com/dhtmltutors/externalcss3.shtml