This hadn\'t hit me until now (and this is not only in webkit browsers). On all texts in like p
tags, h1
tags etc... there\'s an extra space over a
These -webkit-margin
(s) are overwritten by margin: 0; padding: 0;
. Do not worry about them.
Extra space? Maybe you've set line-height:
?
I had the same problem. Suddenly one out of my three table cells containing data its header was moved down a little bit. My problem was simply solved by adding this:
table td
{
vertical-align: top;
}
Seems like some other element in a 'higher' style sheet was telling my data to center itself in the cell, instead of just staying on top.
I guess its just stupid, and wasnt really a problem... but the next person to read this topic might have the same stupid error as i did :)
Take care!
You can also directly modify those attributes like so:
-webkit-margin-before:0em;
-webkit-margin-after:0em;
Works for me in Chrome/Safari. Hope that helps!
I was having this same problem with my <h3>
tag. I tried setting margin:0;
, but it didn't work.
I found that I was habitually commenting out lines in my css by using //
. I never noticed it because it hadn't caused any problems before. But when I used //
in the line before declaring <h3>
, it caused the browser to skip the declaration completely. When I traded out //
for /**/
I was able to adjust the margin.
Moral of this story: Always use proper commenting syntax!
If user agent stylesheet
is kicking in, it is because the tag property was not properly defined in your css stylesheet.
Chances are that a typo, forgotten bracket or semicolon is breaking up your stylesheet BEFORE reaching the tag property settings your page later refers to or "needs".
Run your CSS thru error checking, like CSS LINT and fix whichever errors are eventually detected.
-webkit-margin-before: 0em;
-webkit-padding-start: 0;
-webkit-margin-after: 0em;
This solved it for me when I was having this exact problem.