The Editorfor generates tags HTML
and are where we apply size, color, styles (css
), etc..
The table below is how the Editorfor depending on the type of data:
| --- 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"> |
| ------------------------------------------------------ |
Reference of the site table: tutorialsTeacher.com
To assign CSS with standard size follow the examples below:
Put size in all input
input {
width: 500px;
}
<input type="text" />
Put size in all input
of the kind text?
input[type="text"] {
width: 500px;
}
<input type="text" />
<input type="password" />
Observing: only the input
of the kind text
receives the standard size of 500px
With these two examples you can create CSS for certain types of data, or for a certain type of data tag
HTML.
References:
related: How to apply a style to two different elements using :?
– novic
@Virgilio this works with elements with tags like 'div, a, p' and etc but in my case not... because there is used the Razor
– Fabio Souza
so it is related, independent of anything input, div etc are
tags html
, and get into it. The problem is knowing what that line will generate? you could put that because theEditorFor
generates from a type and the types of a class can and should vary. Whatinput
it generates?– novic
Do you tell me to trade Editorfor for Input? No <Style>?
– Fabio Souza
In vdd this size is just for testing to see if it works
– Fabio Souza
you take a look at the answer?
– novic