开发者

Chrome adds unwanted margin to body

开发者 https://www.devze.com 2023-04-12 08:07 出处:网络
I recently got started with building websites in wordpress, I got tired of building CMS back-ends myself. To start it off nicely i decided to build my portfolio (still in progress, I might add), but f

I recently got started with building websites in wordpress, I got tired of building CMS back-ends myself. To start it off nicely i decided to build my portfolio (still in progress, I might add), but for some reason Chrome adds a weird margin to the top of my website. Every other browser handles the website just fine (even safari, also webkit). I used a CSS reset form to get rid of all the开发者_如何学编程 margins, but this one is really breaking my balls. Any help on how to remove this?

Update:

For anyone landing on this poorly formulated question: the reason for this whitespace was because I didn't put the wp_header() and wp_footer() in the header and footer respectively. This caused Wordpress to add margin for an admin bar, but no hooks to render it. The link I've added previously doesn't relate to the question anymore and I removed it.


It looks fine in Chrome here. There are however some errors in the markup that you would want to fix to be on the safe side. You can never be sure how browsers react to incorrect code.

It's mostly that you have anchor tags around your list elements instead of the other way around.

Validation result

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号