The EditorFor generates tags HTML
and it is in them that we apply size , styles ( css
), etc. .
The table below looks at the EditorFor depending on the data type:
| --- Property DataType --- | ------ Html Element ------ |
| string | <input type="text"> |
| int | <input type="number"> |
| decimal, float | <input type="text"> |
| boolean | <input type="checkbox"> |
| Enum | <input type="text"> |
| DateTime | <input type="datetime"> |
| ------------------------------------------------------ |
Site table reference: tutorialsTeacher.com strong>
To assign CSS with standard size follow the examples below:
Place size in all input
input {
width: 500px;
}
<input type="text" />
Put size in all% of type text ?
input[type="text"] {
width: 500px;
}
<input type="text" />
<input type="password" />
Note: Only input
of type input
gets the default size of text
With these two examples you can create CSS for certain data types, or for a certain type of 500px
HTML .
References: