user3386779
user3386779

Reputation: 7215

css for textbox in asp

I want to write css for textbox in asp.I'm familiar with html,php. Struck to convert html css to asp css.

css for html input

input[type=text],textarea,select,input[type=password]{
float:right;
margin-right:20%; 
width:155px;
}

I want to convert this to input boxes

  <asp:textbox runat="server"></asp:textbox>
  <asp:dropdownlist runat="server"></asp:dropdownlist>

Upvotes: 1

Views: 157

Answers (2)

Izzy
Izzy

Reputation: 6876

You can use CssClass property and then style it as you require. For example

<asp:TextBox runat="server" ID="MyTextBox" CssClass="MyCss"></asp:TextBox>

and then style it using MyCss

Further info here

Upvotes: 1

HEEN
HEEN

Reputation: 4727

You need to find something which has the type attribute equal to text in HTML

CSS

input:not([type]), input[type="text"] {
        background: green;
    }

or make the HTML explicit.

<input name='t1' type='text' id='txt1' />

Now you can customize the CSS attribute according to your requirement.

Hope it helps

Upvotes: 1

Related Questions