I have a div tag, I want to print the content of it. I have done it using Java Script, but I am not getting the styles applied to different texts or textboxes into printout.
I want to get the print with CSS styles. How to do it using Java Script?
Pls help.

Subhankar02dey,

Apply styles in a stylesheet (CSS).

You can specify styles for screen, print and several other media types, with CSS @media directives.

Style directives specified in this way follow the normal cascading rules for order and specificity. Thus, you can have a general group (with no @media{)) for all media types, followed by a @media print{...} group containing just the style differences for printing. In a more extensive arrangement you might then have further @media groups containing style differences for other media types.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.