My page has this extra padding on the top of page that I'm unable to remove. Tried everything under the sun and hope someone can show me the way.
Any ideas?
My page has this extra padding on the top of page that I'm unable to remove. Tried everything under the sun and hope someone can show me the way.
Any ideas?
I'm able to fix it by removing the rule:
* { padding: 0 }
From your CSS. I'm not sure what that's breaking, but that is the cause.
Your page has an element near the top with a top-margin that extends outside your page wrapper. If you have this:
<div class="wrapper" style="margin: 0">
<div class="section" style="margin: 40px 0"> Stuff! </div>
</div>
Then the .section
element will be positioned at the top of the .wrapper
and its 40px margin will extend out the top. This has to do with the way margins collapse together so that two margins between elements don't accumulate. You can prevent this by adding overflow: hidden
on the wrapper.
In your markup, it's the .mini-search
element that has a 40px top margin. Either remove this margin, or add overflow: hidden
on the fieldset that contains it.
i trust you have done:
body {padding :0; margin:0}
by default the body tag has padding.
Use this css code:
/*Reset Safari User Agent Styles*/
* {-webkit-padding-start: 0px;}
The issue you comment is because the user agent style, I learn about it inspecting the body tag with the browser tool. You should track down the element styles on a navigator using the tools it provides (now all the importants include a DOM inspector) so you can demystify the non-standard behavior.
I know you dont ask for it but talking about WebKit stuffs, i paste a code for getting rounded borders on every browser but IE.
.rounded
{
-moz-border-radius:5px; /*works on Firefox */
-webkit-border-radius:5px; /*works on Safari and Google Chrome*/
border-bottom-radius: 5px; /*works on Opera*/
}
Always include the YUI reset css file.
and:
body, html {padding: 0; margin:0}
that's it!
I see a bit of extra padding not on the top but on the sides, in both Chrome and Safari, although it's a bit more pronounced in Chrome.