Solved

CSS doesnt work only in lotus notes email

Posted on 2004-09-20
8
437 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Obsolete font tag need to convert to CSS 3 55
need help with share buttons 11 106
.CSS HTML Help 3 58
Checkbox changes display when resizing window 8 26
When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

738 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