Skip to content Skip to sidebar Skip to footer

Two Print Buttons With Different Css On The Same Page... Possible?

I'm working with Dreamweaver, coded in php. On one of my pages, I'm trying to add 2 different print buttons, each one printing a differrent portion of the webpage. For example, on

Solution 1:

You could dynamically change the print CSS based upon which button is clicked with something like this:

Add an id to your stylesheet reference:

<link rel="stylesheet" href="print1.css"id="printCss" media="print">

Add an on click event to your button:

<inputtype="button" onclick="swapCss();"/>

Dynamically swap the css file:

functionswapCss() {
    document.getElementById('printCss').href = 'print2.css';
}

Post a Comment for "Two Print Buttons With Different Css On The Same Page... Possible?"