I've created a notification that currently has an embedded <style> tag defining the CSS. I want to move that out to a css file so I can share it across all notifications but I can't see to get it working.</p>
<p>I'm assuming my location reference is off but I'm not sure what to change it to. I see that the iTop pages use "../css/cssFile.css" as the location. That is what I'm trying to use but I don't get any of my CSS applied in the generated notification email.</p>
<p>My notification definition starts out like this:</p>
<div class="codehilite"><pre><span></span><code><span class="cp"><!DOCTYPE html></span>
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">type</span><span class="o">=</span><span class="s">"text/css"</span> <span class="na">href</span><span class="o">=</span><span class="s">"../css/mycss.css"</span> <span class="p">/></span>
<span class="p"></</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">body</span><span class="p">></span>
</code></pre></div>
<p>The mycss.css file contains what I had been including in the <style> tag in the notification.</p>
<p>I'm assuming the href specifying the css file location isn't correct?? I have the permissions and owner of that file set to the same as the css files delivered with iTop (apache:apache and 644).</p>
<p>I'd be very grateful if someone can point me in the right direction.</p>
<p>Thanks!</p>
<p>Gene</p></style>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've created a notification that currently has an embedded <style> tag defining the CSS. I want to move that out to a css file so I can share it across all notifications but I can't see to get it working.</p> <p>I'm assuming my location reference is off but I'm not sure what to change it to. I see that the iTop pages use "../css/cssFile.css" as the location. That is what I'm trying to use but I don't get any of my CSS applied in the generated notification email.</p> <p>My notification definition starts out like this:</p> <div class="codehilite"><pre><span></span><code><span class="cp"><!DOCTYPE html></span> <span class="p"><</span><span class="nt">head</span><span class="p">></span> <span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">type</span><span class="o">=</span><span class="s">"text/css"</span> <span class="na">href</span><span class="o">=</span><span class="s">"../css/mycss.css"</span> <span class="p">/></span> <span class="p"></</span><span class="nt">head</span><span class="p">></span> <span class="p"><</span><span class="nt">body</span><span class="p">></span> </code></pre></div> <p>The mycss.css file contains what I had been including in the <style> tag in the notification.</p> <p>I'm assuming the href specifying the css file location isn't correct?? I have the permissions and owner of that file set to the same as the css files delivered with iTop (apache:apache and 644).</p> <p>I'd be very grateful if someone can point me in the right direction.</p> <p>Thanks!</p> <p>Gene</p></style>
Hi Gene,
Beware, email clients are not web browsers. Have a look at:
http://stackoverflow.com/questions/2105963/can-you-link-to-a-css-file-from-an-email
Denis,
Thanks for the reference and the reply. I'll read that and use it to format my notifications.
Gene