Osama khodroj
Osama khodroj

Reputation: 1230

label for="" tag in Firefox !

<label id="hhaaaa" for='<%= hh.ClientID %>'>
    <table style="height: 100px; width: 300px;cursor: pointer" cellpadding="0" cellspacing="0" id="jhuu" onmouseover="Highlight(this.id,true,'ss');" onmouseout="Highlight(this.id,false,'ss');" class="asdqweqwe">
        <tr>
            <td>
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3" style="height: 10px">
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" style="width: 20px; padding-left: 5px; padding-top: 7px"><input id="hh" runat="server" type="checkbox" /></td>
                        <td style="width: 60px" valign="top" align="center"><img src="" /></td>
                        <td align="left" valign="top"><span style="font-weight: bold;"></span><img alt="" id="asd" onclick="" style="cursor: pointer" src="" /></span><br /><span></span></td>
                    </tr>
                    <tr>
                        <td colspan="3" style="height: 10px">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
 </label>

Hello i write this code to make a check box label this code run in all Browser Except Firefox ???!!!!

Upvotes: 0

Views: 607

Answers (2)

sunn0
sunn0

Reputation: 3046

I think this line is the problem:

<td align="left" valign="top"><span style="font-weight: bold;"></span><img alt="" id="asd" onclick="" style="cursor: pointer" src="" /></span><br /><span></span></td>

Remove the span end tag that is not open.

<td align="left" valign="top"><span style="font-weight: bold;"></span><img alt="" id="asd" style="cursor: pointer" src="" /><br /><span></span></td>

Upvotes: 1

Shadow Wizard
Shadow Wizard

Reputation: 66389

The Label can't contain the element it's labeling, it's simply wrong.
(Thanks erKURITA :))

Try something like this first and see if it works fine:

<label id="hhaaaa" for="<%= hh.ClientID %>">Some description here..</label>

As far as I know Label is an inline element so to have it contain other elements add display: block; CSS to it although it's not very elegant and probably against standards.

Upvotes: 1

Related Questions