Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CSS and textbox

Reply
Thread Tools

CSS and textbox

 
 
Stephen Costanzo
Guest
Posts: n/a
 
      01-24-2006
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.


 
Reply With Quote
 
 
 
 
TB
Guest
Posts: n/a
 
      01-24-2006
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

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-25-2006
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

"Stephen Costanzo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Stephen Costanzo
Guest
Posts: n/a
 
      01-25-2006
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.


"Eliyahu Goldin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> "Stephen Costanzo" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
create textbox at run time and insert data from textbox to database tanmaypatankar ASP .Net 0 12-18-2007 03:47 PM
Strange problem with asp:Textbox and CSS filter:alpha sjickells@gmail.com ASP .Net 0 06-21-2007 02:44 PM
Whining and bitching about MSIE 6 CSS bugs and CSS support =?ISO-8859-1?Q?G=E9rard_Talbot?= HTML 0 07-09-2005 06:48 AM
CSS and textbox size Maziar Aflatoun ASP .Net 5 06-14-2004 05:56 AM
Re: VERY STRANGE BUG? Adding a textbox control causes other textbox control to fail??? S. Justin Gengo ASP .Net 0 07-16-2003 06:51 PM



Advertisments