Solved

CSS doesnt work only in lotus notes email

Posted on 2004-09-20
8
423 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
  • 4
  • 2
8 Comments
 
LVL 2

Expert Comment

by:whitefael
Comment Utility
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
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Expert Comment

by:whitefael
Comment Utility
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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now