how to delete margin-top: 32px !important from twenty twelve

前端 未结 12 1036
情深已故
情深已故 2021-01-31 20:52

I want to remove the margin-top property from twenty twelve theme. This is the default theme provided by wordpress. The sample of the code what I found with the help of firebug.

相关标签:
12条回答
  • 2021-01-31 21:16

    You can specify an identifier for the html tag in the template and set it to margin-top: 0! important;

    #html {margin-top: 0 !important;}
    
    0 讨论(0)
  • 2021-01-31 21:17

    Go to the functions file inside your theme folder:

    functions.php

    add_action('get_header', 'remove_admin_login_header');
    
    function remove_admin_login_header() {
        remove_action('wp_head', '_admin_bar_bump_cb');
    }
    
    0 讨论(0)
  • 2021-01-31 21:17

    I think it is because you are logged in in your wordpress account and that 32px space corresponds to the black menu line that is on the top of your page, which doesn't appear but leaves the space for it . Log out and refresh the page and see if it continues or open the website in an other browser.

    0 讨论(0)
  • 2021-01-31 21:19

    Try with show_admin_bar(false); in your functions.php file.

    0 讨论(0)
  • 2021-01-31 21:25

    Add the following function to your functions.php file

    function my_function_admin_bar(){ return false; }
    add_filter( 'show_admin_bar' , 'my_function_admin_bar');
    
    0 讨论(0)
  • 2021-01-31 21:26

    Please try it....

    html.k-webkit.k-webkit78 { margin-top: 0 !important; }

    0 讨论(0)
提交回复
热议问题