Solved

CSS doesnt work only in lotus notes email

Posted on 2004-09-20
8
440 Views
Last Modified: 2006-11-17
When i send an HTML emails, CSS is not working in lotus notes email, where as in hotmail, yahoo its working perfectly. why is it?
0
Comment
Question by:raj_ms
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 2

Expert Comment

by:whitefael
ID: 12102302
Lotus Notes doesn't support CSS (Notes R5 and earlier). Notes 6 does, but it's not great. I found this on the notestips.com website:

by Rod for article http://www.notestips.com/80256B3A007F2692/1/NAMO-5NC24F 

********BEGIN QUOTE*****************

Just in case this point hasn't been made already, the Notes 6 client does have some support for CSS. Of course it's not as complete as the CSS support found in current browsers, but it's only the first crack at it inside of Notes. From that standpoint it's a good start.

There's even a TopStyle definition file for the Notes client available on the LDD Sandbox (OK, buried in the Sandbox...it's there though ;-):

http://www-10.lotus.com/ldd/sandbox.nsf/ConferencePresentationsViewNJ/432396bc10e07f3c85256cd1004ef1fd?OpenDocument

Unfortunately not all the elements support all the same rules (e.g. a [div] in the client can't have a border, while paragraphs can)...so the definition file is certainly not foolproof. Nonetheless, it does help.

Two main differences between browsers and Notes implementations of CSS:

1. In Notes 6, a CSS rule wins over local style info. In a browser, whatever is more local to the element takes precedence. Most obvious example is rich text. As we all know, browsers place a higher precedence on font tags than on CSS rules. In the Notes client however, the CSS rule would win.

2. Each and every line of text rendered in the Notes client is bounded by a paragraph tag. In other words, if you could "view source" on a Notes document, there would be [p] tags everywhere. That's not to say you need to include the [p] tag on every CSS rule. Just be aware of it's presence.

Combine those two, and you can see it is very easy to reset the font-family for an entire document viewed in the Notes client (rich text included):

p{font-family: whatever, alternate, etc}

However, the following wouldn't be very helpful (I learned the hard way):

p{color: black}

As the above 'exceptions' highlight, Notes would then generate all text on the document in the colour black. The only way around that would be to have special rules to override black:

span.header p {colour: blue}

May as well skip the p{color: black} rule in the first place.

Anyway, that's enough rambling (I can get going ;-)

Notes 6 has CSS support, and hopefully that's just the starting point (improvements in future versions would be most welcome--be it increased support for CSS2, and/or auto-CSS generation for Domino).
*************END QUOTE*****************

Hope this helps!
Brian
0
 

Author Comment

by:raj_ms
ID: 12103700
http://www.templatekit.com/lotusnotes1.php
this article explains, but its not addressing my problem.

<tr><td bgcolor="beige" valign="top"><p class="style3" valign="top" align="justify">
<%
      'response.write "<tr><td bgcolor='beige' valign='top'><p class='style3' valign='top' align='justify'><img

src='/images/" & br(index) & "pb.jpg' name='" & br(index) & "'alt='" & br(index) & "p/pm'

border='0' align='left'>&nbsp;"
      response.write "<img src='/images/" & br(index) & "pb.jpg' name='" & br(index) & "'

alt='" & br(index) & "p/pm' border='0' align='left'>&nbsp;"

images are coming the font sizes are not adjusted.



<STYLE type="text/css">
<!--
p.h1 {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 16pt;
      color: #A81616;

}
p.style1 {
      color: #333333;
      font-size: 7pt;
      font-family: Verdana, Arial, Helvetica, sans-serif;
      
}
p.style2 {
      color: #FFFFFF;
      font-size: 11pt;
      font-family: Verdana, Arial, Helvetica, sans-serif;
}
.mainsection {
      background-image: url("/images/mainbg.gif");
      background-repeat: no-repeat;
      background-attachment: fixed;

}
p.style3 {
      color:#333332;
      font-size: 8pt;
      font-family: Verdana, Arial, Helvetica, sans-serif;
}
p.style4 {
      color:#333333;
      font-size: 12pt;
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-color:blue;
}
p.style5 {
      color:#333350;
      font-size: 9pt;
      font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</STYLE>
this is my style sheet. its coming in the form of tables.only font sizes are not adjusting
0
 

Author Comment

by:raj_ms
ID: 12103749
if add a statement like this, its not working
<p class="style3"><i>Step 2</i><br>testing<br><br></p>

where as
<p class="style1">this statement output is correct</p>
this statement is working
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Expert Comment

by:whitefael
ID: 12105448
Based on the article, have you tried commenting out every line of the style sheet? You would end up with:

<STYLE type="text/css">
<!--p.h1 {
     font-family: Verdana, Arial, Helvetica, sans-serif;
     font-size: 16pt;
     color: #A81616;
}-->

<!--p.style1 {
     color: #333333;
     font-size: 7pt;
     font-family: Verdana, Arial, Helvetica, sans-serif;
}-->

<!--p.style2 {
     color: #FFFFFF;
     font-size: 11pt;
     font-family: Verdana, Arial, Helvetica, sans-serif;
}-->

<!--.mainsection {
     background-image: url("/images/mainbg.gif");
     background-repeat: no-repeat;
     background-attachment: fixed;
}-->

<!--p.style3 {
     color:#333332;
     font-size: 8pt;
     font-family: Verdana, Arial, Helvetica, sans-serif;
}-->

<!--p.style4 {
     color:#333333;
     font-size: 12pt;
     font-family: Verdana, Arial, Helvetica, sans-serif;
     font-color:blue;
}-->

<!--p.style5 {
     color:#333350;
     font-size: 9pt;
     font-family: Verdana, Arial, Helvetica, sans-serif;
}-->
</STYLE>
0
 
LVL 2

Accepted Solution

by:
whitefael earned 500 total points
ID: 12113727
You may even have to go as far as putting each style definition as commented and on one line like so:

<!--p.h1 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16pt; color: #A81616;}-->
<!--p.style1 {color: #333333; font-size: 7pt;font-family: Verdana, Arial, Helvetica, sans-serif;}-->
<!--p.style2 {color: #FFFFFF; font-size: 11pt; font-family: Verdana, Arial, Helvetica, sans-serif;}-->

In fact, I would do it this way since the article seems to be doing it like this.
0
 
LVL 2

Expert Comment

by:whitefael
ID: 12523570
I believe my last comment was the answer to the poster's question. There seems to be an issue with the way Notes reads CSS so each line in between the <style></style> tags  needs to be commented.

Brian Wilkins
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question