Support » Requests and Feedback » CSS for adminbar causing print problem

  • I noticed this in version 3.1.0 but it is still present in 3.1.2. I didn’t see anything in the bug tracking system but thought I’d mention it here first to see if anyone else can reproduce it.

    When I print blog entries, I sometimes find that portions of the last line on a page are split horizontally in half, with only the top half of the text showing up. Other times, a complete line of text is omitted completely between one page and the next. This is true in all browsers, as far as I can tell but doesn’t happen on all pages and of course changing the margin settings in the browser affects where it shows up, but not the fact of it showing up.

    I traced the problem to two lines of CSS that are included in the wp-includes/admin-bar.php file. Specifically, if these two lines are commented out, the problem goes away (they are lines 311 and 312 in the 3.1.2 version of WordPress).

    html { margin-top: 28px !important; }
    * html body { margin-top: 28px !important; }

    It seems like this could be fixed by modifying the line above them, the opening style tag, to specify that this rule only apply to screen layout. Since the admin-bar doesn’t print in any case, I don’t see any downside to this.

    <style type=”text/css” media=”screen”>

    Comments? Should I file a bug?

  • The topic ‘CSS for adminbar causing print problem’ is closed to new replies.