CSS and textbox

S

Stephen Costanzo

This is my first attempt at working with style sheets so I am probably
missing something obvious.

I created a default ASP.NET Web Application and added 3 elements to it, a
label, a text box, and a hyperlink.

I changed the default style sheet to have the label color be purple (added
color: purple; to the Body {}).

I changed the hover for the hyper link to lime (changed color: lime; in the
A:hover {})

But what I cannot figure out is the text box entry area. I modified the
TextBoxLabel{} and the TextBoxStyle{}, even added the TextBox{} to the css
file to no avail.

I set the CssClass property to TextBox thinking that was where I was going
wrong.

using ASP.Net 1.1 and VS 2003.

Thank you in advance.
 
T

TB

I am not an expert on this, but I can tell you that I have succesfully
used a style sheet to format textbox to define for example font
properties and textbox height. Like this:

In page.aspx:

<asp:textbox id="txbTest" CssClass="textbox"
Runat="server"></asp:textbox>

In Styles.css:

..textbox
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-style:normal;
height:18px;
}

Cheers

TB
 
E

Eliyahu Goldin

Asp.net translates aspx pages to html and css rules apply to html pages, not
to aspx ones. There is no TextBox in html. It becomes, or renders as, an
html control of <input type="text" ...>. You can either declare styles for
<input type="text"> or use
CssClass attribute as another poster is suggesting.

Eliyahu
 
S

Stephen Costanzo

Thank you both for your suggestions.

The thing I was missing was the <period> before the class name. inserting
the period allowed it to work. Eilyahu thank you for providing the alternate
way so I don't have to always put a CssClass attribute in for each of the
text boxes.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top