Set the asterik (star) mark on the top right of TextBox in ASP.Net

Last Reply 6 months ago By dharmendr

Posted 6 months ago

I need to set the asterik mark out of textbox on the top right corner but by using below code it is coming on the bottm of textbox on the left side but i need it on top of textbox.How can i do this 

<td align="left" id="selectmsg">
    <div id='selectval' class='insideSelect newSelect' style="font-weight: normal;width:263px !important;"></div><span class="requiredfields" style="display:inline-flex !important;">*</span>
</td>

inside the div element the text box gets created at runtime

You are viewing reply posted by: dharmendr 6 months ago.
Posted 6 months ago Modified on 6 months ago

Hi kavithav,

Place the span in another div and add float: left to the selectval div.

Check the below example.

HTML

<table>
    <tr>
        <td align="left" id="selectmsg">
            <div id='selectval' class='insideSelect newSelect' style="float: left; font-weight: normal;
                width: 263px !important;">
                <input type="text" style="width: 250px;" />
            </div>
            <div style="float: left;margin:auto; display:table;">
                <span class="requiredfields" style="display: inline-flex !important;">*</span>
            </div>
        </td>
    </tr>
</table>

Demo