Cascading Style Sheet

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

I am trying to work with cascading style sheet in VB.NET. I have never
used CSS. I see that the TextBox has a property of "CssClass" and I was
wondering how to use it. I placed the following in the <HEAD> section

<style>
TxtStyle1 { TEXT-ALIGN: right }
</style>

For a textbox, I set the "CssClass="TxtStyle1" but it had not effect. How
can I properly use this?
 
Jim,

You are very close add a "." before the class name.

<style>
.TxtStyle1 { TEXT-ALIGN: right }
</style>

Now it should work.

Regards,
RedEye
 
Jim,

You are very close add a "." before the class name.

<style>
.TxtStyle1 { TEXT-ALIGN: right }
</style>

Now it should work.

Regards,
RedEye

Thanks.. It does indeed now work.

So what is the deal with requiring a "." in front of the name when you
define it, but not requiring a "." when you specify the
"CssClass="TxtStyle1"? Maybe it does require it but it is just very
forgiving?
 
When writing a custom class inside your <style> tags the "." means that it's
a custom class and that you're not just defining, say the <BODY> tag. When
you set the class the item, it already knows it's a custom class else you
would not have to specify it.

jM
 
Back
Top