469,299 Members | 2,079 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

CSS and textbox

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.
Jan 24 '06 #1
3 2355
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

Jan 24 '06 #2
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" <sx********@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP15.phx.gbl...
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.

Jan 25 '06 #3
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" <re*************@monarchmed.com> wrote in message
news:en**************@TK2MSFTNGP12.phx.gbl...
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" <sx********@hotmail.com> wrote in message
news:uk**************@TK2MSFTNGP15.phx.gbl...
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.


Jan 25 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jonas L | last post: by
4 posts views Thread by Rodrigo DeJuana | last post: by
7 posts views Thread by I am Sam | last post: by
11 posts views Thread by Keith | last post: by
3 posts views Thread by Brad Rogers | last post: by
8 posts views Thread by Marco Pais | last post: by
1 post views Thread by Andy B | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.