tags:

views:

42

answers:

1

Hi! ASP.Net has a tag called CheckboxList. The output of this tag looks like this:

<table class="checkbox">
<tbody>
<tr>
    <td>
        <input id="/*longdynamicstring1*/" type="checkbox" name="/*longdynamicstring2*/" />
        <label for="/*longdynamicstring1*/">Label Text</label>
    </td>
</tr>
</tbody>
</table>

I want to position the label and the input but I cannot find out how. Tried the following:

.checkbox input{
padding-right: 5px;
}

and

.checkbox input[type='checkbox']
{
    padding-right: 5px;
}

but neither of them had any effect. Because it's ASP I cannot set a class for the input elements and I cannot reference the id because it's dynamic.

A: 

Your selector works well, it's just that padding has no effect on the check box. Margin will work, for example:

.checkbox input {
    margin-right: 50px;
}

See it in action: http://jsbin.com/irari

In addition, take a look at the RepeatLayout property - it can make the generated HTML more CSS friendly.

Kobi
Thank you! I usually try other properties to see that something really doesn't work but in this case somehow I forgot it.
nosferat
@nosferat - No problem. Welcome to Stack Overflow!
Kobi