Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2011
    Posts
    100
    Thanks
    25
    Thanked 0 Times in 0 Posts

    How to disable (=set to default) CSS keys display: flex and flex-direction: column?

    I have troubles when printing a web page in Firefox (into pdf file). The web page does not detect resp. insert page breaks.

    I found out that everything works fine when I disable (=uncheck) the checkboxes before the CSS key values

    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;

    I have no access to the original web page code or server.
    So I have to change them after loading by a javascript script

    How can I disable them resp. whats the default (=non flex value)?

    display: none !important;
    flex-direction: none !important;

    does not help

    How else can I achieve it?

    What about disabling flex compoletely including the CSS values
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    Last edited by pstein; May 14th, 2019 at 10:46 AM.

  2. #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    3,499
    Thanks
    3
    Thanked 624 Times in 610 Posts
    Hi there pstein,

    this is the CSS method for page breaks...

    Code:
    
    <style media="print">
    
    element { 
        page-break-before: always; 
      }
    
    </style>

    coothead
    ~ the original bald headed old fart ~

  3. #3
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    11,301
    Thanks
    7
    Thanked 1,360 Times in 1,329 Posts
    Quote Originally Posted by pstein View Post
    How can I disable them resp. whats the default (=non flex value)?

    The defaults depend on the elements. Can be block, inline, table, list-item (for list items, obviously) etc. But look at the end of the list of values on https://developer.mozilla.org/en-US/...eb/CSS/display There are two values called “initial” and “unset”.

  4. #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    3,499
    Thanks
    3
    Thanked 624 Times in 610 Posts

    Quote Originally Posted by pstein View Post

    I have no access to the original web page code or server.
    So I have to change them after loading by a javascript script.
    If you "View Source" > "Select All" > "Copy" > "Paste" into your text editor,
    adding a "base href element", if necessary, and then save the file with an
    html extension, you will then have a replica page with which to work.

    Adding this...

    Code:
    
    <style media="print">
    
    element(s) { 
        page-break-before: always; 
      }
    
    </style>
    ...to the document will then provide the required page breaks.

    Check out the attachment, which shows page breaks using this
    page as an example.

    coothead
    Attached Files Attached Files
    Last edited by coothead; May 14th, 2019 at 11:43 PM.
    ~ the original bald headed old fart ~


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •