Results 1 to 2 of 2

Thread: Add color to my form

  1. #1

    Thread Starter
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Add color to my form

    My form is very bland, being just black and white. I did this in paint. How could I do something like this through VS?


  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Add color to my form

    put an enclosing <div></div> around your textboxes, and use CSS to set the backcolor.

    You should always have a style sheet to set common display colors etc..
    You put a link tag in the head section of your aspx page like so.
    Code:
    <head>
    ...
    <link rel="stylesheet" type="text/css" href="Styles.css">
    </head>
    You enclose your textboxes in a div with a classid (colored in this case) like so:
    Code:
    <div class="colored">
    <asp:textbox id="123" runat="server" />
    <asp:textbox id="124" runat="server" />
    </div>
    You add a style-sheet to your project (add new item... style sheet.. call it 'Styles.css'),
    then add a style identifier for your class ('colored').
    in the style sheet:
    Code:
    div.colored
    {
    padding: 20px;
    width: 400px;
    border: solid 1px #000000;
    background-color: #555555;
    }
    Save all, and run.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width