显示radiobuttonlist内联 [英] display radiobuttonlist inline

查看:142
本文介绍了显示radiobuttonlist内联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网页上有几个放射学家。我面临的问题是单选按钮的文本不显示在放射状按钮的内联。我把repeatLayout到表和流,两者都不工作。我试图添加一种显示风格:inline;但是这不工作(虽然它在复选框,我认为也许会工作在这里)。

I've got a few radiolists on my page. The problem that I am facing is that the text of the radio buttons are not displayed inline of the radion button. I have put the repeatLayout to Table and Flow and neither is working. I have tried to add a style of display:inline; but that doesn't work either (though it did on the checkboxes and I thought that maybe it would work here too).

这只是一个正常的放射学家:

This is just a normal radiolist:

<asp:RadioButtonList ID="radRace" CssClass="radioButtonList" runat="server" RepeatDirection="Horizontal">
    <asp:ListItem>Race 1</asp:ListItem>
    <asp:ListItem>Race 2</asp:ListItem>
    <asp:ListItem>Race 3</asp:ListItem>
    <asp:ListItem>Race 4</asp:ListItem>
</asp:RadioButtonList>

ul.radioButtonList { list-style:none; margin: 0; padding: 0;}
ul.radioButtonList.horizontal li { display: inline;}

当repeatLayout在表格上时:

When the repeatLayout is on table:

当repeatLayout开启时:

And when the repeatLayout is on Flow:

有人可以帮助我如何设置它,使文本显示如果它有所作为,radioButtonList在一个表....

Can Somebody please help me on how to set it so the text is displayed next to the radio button... If it makes a difference the radioButtonList is in a table....

解决方案:

这是现在的单选按钮列表:

This is what the radio buttonlist look like now:

<asp:RadioButtonList ID="radRace" CssClass="radioButtonList" runat="server" RepeatDirection="Horizontal">
    <asp:ListItem>Race 1</asp:ListItem>
    <asp:ListItem>Race 2</asp:ListItem>
    <asp:ListItem>Race 3</asp:ListItem>
    <asp:ListItem>Race 4</asp:ListItem>
</asp:RadioButtonList>

这是cssClass:

And this is the cssClass:

<style type="text/css">
    .radioButtonList { list-style:none; margin: 0; padding: 0;}
    .radioButtonList.horizontal li { display: inline;}

    .radioButtonList label{
        display:inline;
    }
</style>


推荐答案

尝试:

.radioButtonList label{
    display:inline;
}

适用于我,但如果它不适合你,尝试此解决方案
http://forums.asp.net/t/1089664.aspx/1

works for me, but if it doesn't work for you then you might try this solution http://forums.asp.net/t/1089664.aspx/1

他将输入和标签显示为块,并浮动。

He displays the input and label as block and floats both.

这篇关于显示radiobuttonlist内联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆