Cascading Style Sheet

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?
 
R

RedEye

Jim,

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

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

Now it should work.

Regards,
RedEye
 
J

Jim Heavey

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?
 
J

Justin Musick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top