I am reading a book about CSS basics. It is claimed in the book that an inline element has complete padding properties but no margin-top/bottom properties, only margin-left/right properties.
My first question is, where can I find this as an official statement? I found here that if margin-top/bottom is set to auto
then it is set to 0
. But isn't that different from saying margin-top/bottom does not apply to inline-elements?
My second question is, does an inline element really got complete padding properties? I tried the following example:
<!DOCTYPE html>
<html>
<head> </head>
<body>
<div style="margin: 20px; border: solid 20px;background: red;">
<p style="margin:0">
test test test test test test test test test test test test test test test test test test test test test test test test
<strong style="padding:20px;background-color:yellow">hello</strong> test test test test
</p>
</div>
</body>
</html>
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…