简体   繁体   中英

Chrome Developer tools orange box

I know that the orange box in developer tools represents margin but when I do margin: 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.

İf you remove this orange box you can give your element 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%; .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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