Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

29 December 2010

HTML : white space nowrap

In the gold days to avoid a white space wrap we could use the nobr tag. Now since the tag is deprecated we must use css:

.nobr { white-space:nowrap; }

This class can be applied to a span with the text we need to avoid the wrap.

29 February 2008

How to insert a page break always in HTML

A common problem in HTML is how to insert a page break after an HTML element, to print a report for instance.

The solution is the page-break-after attribute defined as always.

Example:
Define the following style in the a CSS file or the HEAD HTML element:

<style> 
p { page-break-after: always } 
</style> 
In the body you can do the following: 


<div>:Insert a page break....</div> 
 
<p>This is a page break. </p> 

The text inside the <p> tag will appear in a new page.