css - Can't see the border-top in this inline element -


If I remove the border or I change the block to block or inline-block then the inline element is displayed completely is. I do not understand why I can not see the boundary.

Enter image details here

html:

  & lt; Div class = "content" & gt; Test Test Test & lt; / Div & gt;   

CSS:

  body {padding: 0; Margin: 0; } .content {display: inline; Background: YellowGreen; Border: 5px solid red; }   

Give me the quote: < Blockquote>

Display: Inline means that the element is displayed inline in the existing block on the same line, only when it is between two blocks, then the element is an 'anonymous block' , Though its smallest possible width is.

But if the top border will be taken into account, then it is misconstrued incorrectly with other elements on the same line as your div Even if in your case there is only one element on the line. However, the top boundary is ignored, so it is "sticking" to the body and you can not see it.

As "proof", try modifying your HTML code in the Bella provided:

Then you The top limit will be able to see, because there is not enough space for the height of the original element, as it does not have to be left.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -