Marek
Marek

Reputation: 111

How can I change size of textBox in MVC?

Change of size doesn't work :(

@Html.TextBox("Imie", new { @class = "boxx" })

Css:

.boxx{
    height : 400px;
    width : 500px;
}

the class = "boxx" is wrote in textBox

Upvotes: 1

Views: 869

Answers (3)

Dummy
Dummy

Reputation: 265

you can also try Inline css if you want to

@Html.TextBox(x => x.testBox, new { style = "width: 20px;" })

Upvotes: 1

Sunil Kumar
Sunil Kumar

Reputation: 3242

you can try below code:

@Html.TextBox("Imie", null, new { @class = "boxx" })

3rd value is for HTML attribute.

Hope it solved your issue.

Thanks

Upvotes: 1

LDJ
LDJ

Reputation: 7304

Have a look at the docs (or intellisense) and you will see the available overloads. Try

@Html.TextBox("Imie", null, new { @class = "boxx" })  

Upvotes: 2

Related Questions