locked
Show text beside <input asp-for="b1" type="text" class="form-control"> on the same line RRS feed

  • Question

  • User-540818677 posted

    I have the following code inside my razor view inside an Asp.Net MVC core web application:-

    <td>
    <input asp-for="b1" type="text" class="form-control">%
    </td>

    where the % sign will be shown on a new line, so can i show the % and the input field beside each other on the same line?

    Monday, May 18, 2020 11:46 PM

Answers

  • User711641945 posted

    Hi johnjohn123123,

    If you add any other css style to your td or input elements,please share with us.If do not add any other css style,just using the following code:

    <td style="display:flex">
        <input asp-for="b1" type="text" class="form-control">%
    </td>

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 19, 2020 1:34 AM

All replies

  • User2078676645 posted

    Hi johnjohn123123

    You can use the relative positioning method to put % after the text box, for example:

    <input type="text" class="form-control"><span style=";top:-30px;left:200px;">%</span>

    Best Regards,

    Evern

    Tuesday, May 19, 2020 1:01 AM
  • User711641945 posted

    Hi johnjohn123123,

    If you add any other css style to your td or input elements,please share with us.If do not add any other css style,just using the following code:

    <td style="display:flex">
        <input asp-for="b1" type="text" class="form-control">%
    </td>

    Best Regards,

    Rena

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 19, 2020 1:34 AM