Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: Margin not present in the inspector but present on the page

Tags:

css

margin

I have a page that is using ng2-charts and the charts have a margin-right that I cannot find in the inspector. However when I scroll down and point at the margin(see screenshot) it clearly shows a right margin on the page. So there is margin but I cannot see it as a property and I cannot manipulate it.

Why?

enter image description here

like image 819
Nikolay Avatar asked Sep 01 '25 10:09

Nikolay


1 Answers

This seems to be the Chrome Dev Tools' way of saying: the display:block; element doesn't occupy the full width, but there still can't be any element next to it, because of the block-display. Here's a code snippet to reproduce:

div {
  width: 50%
}
<div>Placeholder text</div>
like image 178
LarsW Avatar answered Sep 03 '25 01:09

LarsW