Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
222 views
in Technique[技术] by (71.8m points)

html - 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?

question from:https://stackoverflow.com/questions/65917693/chrome-developer-tools-orange-box

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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%;.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...