Use computed text to write cross-browser & cross-platform CSS

Annoyed by how Netscape renders a font size differently than Internet Exlorer...or how a Mac renders different from Windows?

Annoyed by how Netscape renders a font size differently than Internet Exlorer...or how a Mac renders different from Windows? Domino has a feature no other Web platform offers, computed text! Its easy to fix these browser and platform differences with CSS. Here's how...

Modify your exisitng CSS to use Computed Text where ever the differences occur. (Your CSS will need to be a page or form and not an Image Resource in order to do this.)

Since the prime differences occur in frame spacing and font sizes, I've provided examples for both.

FONT SIZE DIFFERENCES:
Sample CSS:
a { cursor:auto; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold; color: #006}

In this scenario, create computed text to replace the 12px for the font-size. The formula would be:

@If(@BrowserInfo("BrowserType")="Netscape" &
@BrowserInfo("Platform")!="MacOS";"13px";"12px")

*Notice Mac NS renders the same as IE!

*Use pixels instead of point size to make your CSS campatible across platforms. If you wanted to use point sizes, similar code would be:

@If(@BrowserInfo("BrowserType")="Netscape" &
@BrowserInfo("Platform")!="MacOS";"9pt";"8pt")

FRAME ROW AND COLUMN DIFFRENCES:
Since Netscape rounds to the nearest 5 pixels, your frameset may not appear exactly as you like. For instance if the graphic you designed is 80 pixels high, you would like your frame to be as well.

Here's code to help:
Partial Frame HTML:
<FRAMESET FRAMEBORDER=0 BORDER=0 ROWS="76,*">

Replace the 76 with Computed Text:
@If(@BrowserInfo("BrowserType")="Netscape";"80";"76")

*Unfortunately, this means you would not be able to use Domino frames, and you would have to copy the code it usually renders into a page where you can adjust the code as needed.

This was first published in January 2002

Dig deeper on Domino Resources - Part 4

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close