Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align a star vertically in the middle to a text area

Tags:

html

jquery

css

Right now the star is at the bottom of the textarea. How to align the star in below html vertically to the middle of the textarea.

Here is the html

 <table>
    <tr>
        <td valign="middle">
            <textarea id="txtDescription"></textarea>
                    <span class="star">*</span>
        </td>
    </tr>
</table>

And the style

  .star
    {
        color: #ff0000;
        margin: 0 0 0 5px;
    }

Here is the demo

like image 710
iJade Avatar asked Sep 30 '22 11:09

iJade


1 Answers

Create a new <td> and add there star:

html

<table>
        <tr>
            <td valign="middle">
                <textarea id="txtDescription"></textarea>

            </td>
            <td>
                <span class="star">*</span>                
            </td>
        </tr>
    </table>

fiddle

like image 121
Alex Char Avatar answered Oct 03 '22 00:10

Alex Char