CSS and textbox

Discussion in 'ASP .Net' started by Stephen Costanzo, Jan 24, 2006.

  1. 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.
     
    Stephen Costanzo, Jan 24, 2006
    #1
    1. Advertising

  2. Stephen Costanzo

    TB Guest

    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
     
    TB, Jan 24, 2006
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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.
    >
     
    Eliyahu Goldin, Jan 25, 2006
    #3
  4. 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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >> 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.
    >>

    >
    >
     
    Stephen Costanzo, Jan 25, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    534
    S. Justin Gengo
    Jul 16, 2003
  2. Maziar Aflatoun

    CSS and textbox size

    Maziar Aflatoun, Jun 13, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    14,951
    Trevor Benedict R
    Jun 14, 2004
  3. =?ISO-8859-1?Q?G=E9rard_Talbot?=

    Whining and bitching about MSIE 6 CSS bugs and CSS support

    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Jul 9, 2005, in forum: HTML
    Replies:
    0
    Views:
    415
    =?ISO-8859-1?Q?G=E9rard_Talbot?=
    Jul 9, 2005
  4. Replies:
    0
    Views:
    1,053
  5. tanmaypatankar
    Replies:
    0
    Views:
    1,084
    tanmaypatankar
    Dec 18, 2007
Loading...

Share This Page