开发者

style input tag

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']
{
    padd开发者_StackOverflowing-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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜