为什么chrome会突出显示未在样式中列出的边距或计算的边距 [英] Why is chrome highlighting a margin that is not listed in styles or computed

查看:123
本文介绍了为什么chrome会突出显示未在样式中列出的边距或计算的边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



样式下没有显示页边距样式,正如您可以看到的那样, t显示任何被计算的。不知道这里发生了什么,但是在将元素的宽度更改为90%后,我注意到了这一点。我正在使用基础,所以也许它的一些竞争风格?



我不问如何解决我的具体问题,这就是为什么我没有发布代码。我只是困惑,为什么chrome会突出显示一个保证金,当它没有显示任何要计算 这是由 display:block 规则引起。



该元素占据了其父项的整个水平空间,因此chrome尝试通过使用边距颜色为占用的空间着色来表达这一点。



将规则更改为 display:inline-block display:inline 来解决问题。


There are no margin styles being shown under "styles", and as you can see it doesn't show any being computed either. No idea what's going on here but I noticed this right after changing the width of the element to 90%. I'm using foundation so maybe its some competing styles?

I'm not asking how to fix my specific issue which is why I've posted no code. I'm just confused why chrome would highlight a margin when its not showing any to be computed

解决方案

This is caused by the display: block rule.

The element is occupying entire horizontal space of it's parent, so chrome tries to convey that by coloring the occupied space with the margin color.

Change the rule to either display: inline-block or display: inline to remedy the issue.

这篇关于为什么chrome会突出显示未在样式中列出的边距或计算的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆