Home > Domino Tips > Developer > HTML > Use computed text to write cross-browser & cross-platform CSS
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

HTML

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


Angie Schottmuller
01.23.2002
Rating: -4.00- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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...

Code

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.


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
HTML
A bevy of Notes/Domino development tips
Styling Lotus Domino Web fields
How to convert Microsoft Word or Microsoft Excel documents to HTML
An easier way to view multiple columns on the Web
How to print a form in landscape format automatically
Tip contest winner: Hide view column while being able to sort it
HTML signature maker
JavaScript autoclose window
Hide relevance score using inline style tag
Profile forms for CSS sheets

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts