WordPress header margin override

There used to be a margin in WordPress header.This is because of margin-top: 32px !important; style property.You can remove that by adding the below code in themes functions.php file .

<?php add_action( ‘wp_head’, ‘mp6_override_toolbar_margin’, 11 );
function mp6_override_toolbar_margin() { ?>
<style type=”text/css” media=”screen”>
html { margin-top: 0px !important; }
* html body { margin-top: 0px !important; }
</style>
<?php
}?>

Leave a Reply

Your email address will not be published. Required fields are marked *