When using wordpress to build a website and write themes, occasionally there will be a 28 PX height gap between the top of the website and the browser, even if the Declaration * {margin: 0;} In CSS remains unchanged! Using Chrome to review elements occurs in the entire html, rather than an element in html.
This problem is because wordpress's wp_head () function adds a style by default!
<Style type = "text/css" media = "print" ># wpadminbar {display: none ;}</style>
<Style type = "text/css">
Html {margin-top: 28px! Important ;}
* Html body {margin-top: 28px! Important ;}
</Style>
We can delete this style, and then we will wonder why wordpress will add this style? It turns out that wordpress is used to display the position left by the toolbar on the top of the website after the Administrator logs on. This is often the case when the website Administrator logs on to the wordpress background and then opens the website front-end page. It's easy to think about it. We just need to retrieve the toolbar that should have been displayed ~ The solution is to add the </body> label <? Php wp_footer ();? > The function is ready ~
Link to this article: http://www.uqishi.com/wordpress_top_28px_spacing.html reprint please indicate the source.