Forum Moderators: not2easy

Message Too Old, No Replies

CSS in a Vbscript form - email

Is it possible to use css in a vbscript form?

         

Jeff_me

3:22 am on Feb 22, 2006 (gmt 0)

10+ Year Member



Is it possible to use css in a vbscript form? What I'm doing is I have an html form. I'm sending the html form information to an asp vbscript page and it sends an email. Is is possible to insert css so I don't have use html tags in the vbscript? If this is possible, how do you do it because I can't get it to work.

-

DrDoc

3:42 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld! [WebmasterWorld.com]

Not only does the email content need to be sent properly (as text/html with 7-bit encoding), but there must be HTML content for the CSS to be applied. Now, whether you include the CSS using <style> tags or inline styles (using the style attribute) really doesn't matter. But there must be HTML in the first place. Else it is just plain text, and it cannot be formatted nor styled using CSS.

Jeff_me

3:49 am on Feb 22, 2006 (gmt 0)

10+ Year Member



Thank You and thanks for the reply.

Everything is set properly far as html. The email looks great when using html font tags but when using css is doesn't work. Can somebody post an example of how CSS would look in vbscript? This is what i'm using below -


<script>.back {background-color: #F9F9F9; border 1px; solid #000000;}</style>

-

DrDoc

4:10 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, for example:

<style type="text/css">
body {
background: yellow;
color: red;
font: 12px 'Trebuchet MS', Verdana;
}
</style>

At the very least you must enclose your style sheet with:

<style type="text/css">
</style>

Fixed typo

[edited by: DrDoc at 4:44 am (utc) on Feb. 22, 2006]

Jeff_me

4:30 am on Feb 22, 2006 (gmt 0)

10+ Year Member



Yes I tried <style type="text/html"> and tried <style type="text/css"> but no luck. I tried <style> just to try something, to see if maybe it would work. vbscript doesn't like something. Oh well thanks for trying.

-

DrDoc

4:43 am on Feb 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



do you have the <body> element and all?