WordPress Web browser Top blank 28px height solution

Source: Internet
Author: User
Keywords WordPress

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

In the use of WordPress building sites and writing topics, occasionally occurs in the top of the Web site from the browser has a 28px height blank, even if the CSS declaration *{margin:0;} Still no change! Using Chrome to review elements looks to be in the entire HTML, not an element in HTML.

The problem is actually 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 think why does WordPress add this style? Originally, WordPress is for the administrator to log in after the site to the top of the toolbar left the display location, Think about it. This situation often occurs when the webmaster logs in to WordPress background and then opens the front page of the site. It's easy to think about everything here, we just have to find the tool bar that should be displayed. The solution is to add < PHP wp_footer () to the foot template </body> tag. > function on it ~

This article link: http://www.uqishi.com/wordpress_top_28px_spacing.html reprint please indicate the source.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.