简体   繁体   English

Chrome 开发者工具橙色框

[英]Chrome Developer tools orange box

I know that the orange box in developer tools represents margin but when I do margin: 0;我知道开发人员工具中的橙色框代表边距,但是当我做边距时:0; to a block element it is still there (the orange box), I know that block element takes full width always and doesn't allow other elements on the same row/line, so what is that orange box which takes full width (of what's left of the width)?对于一个块元素它仍然存在(橙色框),我知道块元素总是采用全宽并且不允许同一行/行上的其他元素,那么那个采用全宽的橙色框是什么(什么是宽度的左侧)? Is it just margin that you cannot remove or is it something else?只是您无法删除的边距还是其他原因?

There is nothing about margin, its all about when you give display:block your elements wants to width:100% but you give width:200px so this orange box occured to keep the whole line.边距无关紧要,这一切都与您何时给出display:block您的元素想要width:100%但您给出width:200px所以这个橙色框出现以保持整行有关。

İf you remove this orange box you can give your element display:inline-block;如果你删除这个橙色框,你可以给你的元素display:inline-block; but at this time your another elements can come next to the element you are using.但是此时您的另一个元素可以位于您正在使用的元素旁边。 If you want to prevent this, you can make a container class and give it width:100%;如果你想防止这种情况,你可以制作一个容器 class 并给它width:100%; . .

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

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