TIPS - How to force font style of Lotus Notes rich text items on Web
I hate web site where text font changes between pages. It's possible to control graphical chart on public web sites but it's impossible with Intranet applications. If we define default font on rich text field, the users can change it. They just have to copy/paste Word document or Web Page in rich text to lose default font property.
Fortunately, Lotus Domino uses "old" html tag to change font properties : <font>. I don't use any more this font since CSS style sheet. If you redefine the properties of this tag in a CSS style sheet, you can bypass text font arguments passed by Lotus Domino and then force your text font properties for all the informations in rich text field.
For example if I define style :
<style>
font {
font-family : tahoma, arial, helvetica, sans-serif;
font-size : 1em;
}
</style> All the content of the rich text will be display in tahoma 1em. The user can add bold or italic but if he defines bigger size font, the content of the text will be display on Web in 1em, no more.With this method you force font properties of all <font> tag of your document. If you want to restrict the effect to only one rich text field only, you just have to embedded it in div with specific class name :
<div class="mybody">
Richtext field
</div>Then style sheet will look like this:<style>#mybody font {
font-family : georgia, "Times New Roman", Times, Roman, serif;
font-size : 12px;
}</style>
Version française





3 comments:
Hello Philippe,
I thought that the Domino/HTML < font face... > is stronger than the font style in a CSS, and therefore will take precedence over the CSS style. Seems I was wrong. Good news! Thanks for the tip!
Roger
This was precisely what I was looking for! Thank you for posting it.
-Sabrina
I realise that this is a somewhat dated reply but even so I'd like to say thanks to Phillippe. I too thought that the HTML font tag would have precedence over CSS. But thanks to Phillippe this was exactly what I needed - a simple and straight forward solution.
Post a Comment