Styles for best-possible print results in online documentation |
Styles for best-possible print results in online documentationWhen users print out a topic of an online documentation, this topic is particularly important to them. Therefore, the printout should be designed professionally and contain exactly what is important when reading on paper. With just a few lines of additional CSS and HTML code, you can significantly contribe to a positive user experience here. Example 1: Hide elements that are irrelevant for printingTake a look at the print preview of the page that you are currently reading. There you will not see the header of the website, and you will not see the footer and the navigation bar either. Implementation for example 1In the CSS file used by your online documentation or in the head section of your page template, for the print medium, set the display property to the value none for all elements to be hidden in print. Note: In the output of most authoring tools, these properties will already be set accordingly by default. However, if you have made changes to the layout or added elements to the page template yourself, you may have to disable visibility in print for these elements as well.
Example 2: Printing the target address along with hyperlinksHyperlinks cannot be clicked on paper. Users can only visit a page mentioned on paper if they know its address (URL). You can achieve this with well-designed CSS specification for links: Where there is an active, clickable link on the online page, on the printout in addition the URL contained in the link appears after link anchor text. Take a look at the print preview of this page and check out the following reference: indoition information development Implementation for example 2Add the following CSS code to the CSS file used by your online documentation or to the head section of your page template:
Example 3: Header and footerIf you want to produce a truly professional printout, there are even ways to set up a repeating header and footer that appears on each page of the printout. Try it out. Print this page or look at the print preview! Implementation for example 3The solution is somewhat convoluted, but it only needs to be set up once on the page template and then works automatically everywhere. Step 1: Add the following CSS code to the CSS file used by your online documentation or to the head section of your page template:
Step 2: At the beginning of your page template, put the content of the header to be printed between the following two HTML snippets:
Step 3: Immediately below, place the content of the footer to be printed between the following two HTML snippets:
Step 4: Below that, place the following two HTML snippets to enclose the regular topic content that is to be displayed also on screen:
|