简体   繁体   English

Chrome开发者工具,谁在设置高度/宽度?

[英]Chrome dev-tools, who is setting the height/width?

I found that I am helpless - when I need to find who is responsible for setting elements property values. 我发现我很无助-当我需要找到负责设置元素属性值的人时。 It usually takes a while to pin point the problem. 找出问题通常需要一段时间。

Can anybody share the best strategy if you come to the page - see that computed height is "500px", but no body set it explicitly - yes, I eventually find the reason but I would like to be a bit more methodical. 如果您进入页面,任何人都可以分享最佳策略-看到计算出的高度为“ 500px”,但是没有任何主体对其进行明确设置-是的,我最终找到了原因,但是我想更加系统地介绍。

Thank you 谢谢

For Google Chrome browser 对于Google Chrome浏览器

  • right click on element and select Inspect element 右键单击元素,然后选择Inspect element
  • expand Computed tab and look for offending style 展开“ Computed选项卡,然后查找冒犯的样式
  • find property that you need and click small triangle to the left of style definition. 找到所需的属性,然后单击样式定义左侧的小三角形。 On click it should expand list of selectors that affects this style for this element 单击时,它应该展开影响该元素此样式的选择器列表

Read more 阅读更多

在此处输入图片说明

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

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