css3 - margin-top and margin-bottom do not work with html a element? -
I was trying to understand the CSS transition property and I understood. But I got another confusing stuff when I was giving the margin: 10px; , And I saw the result on the chrome, there was no padding-top or padding-down, that means padding-left and padding were right. To run this margin, I have tried to change an element with P element, and the margin was good. And here's my code:
jsfiddle.net/forbloggerku/L3Mps/
I have tried to find an article about the html element related to this problem, but I did not find it . Please tell me the reasons why the margin-top and margin-less HTML elements do not work with, and please give me the URL of your reasons. Thanks in advance ..
Your problem is that the anchor tag "a" is an inline element that blocks elements Do not behave like. Add a display for an element: Inline block in your CSS and which will keep it correctly. Each of the blocks and inline elements has its own rules.
Comments
Post a Comment