显示单选按钮列表内联 [英] display radiobuttonlist inline

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

问题描述

我有我的网页上几个radiolists。我现在面临的问题是,单选按钮文本不显示radion按钮内嵌。我已经把repeatLayout表和流量既不工作。我已尝试添加显示器的风格:内联;但是,这并不工作,要么(虽然它做了的复选框,我想,也许它会太在这里工作)。

这是只是一个普通的单选列表:

 < ASP:RadioButtonList的ID =radRace的CssClass =单选按钮列表=服务器RepeatDirection =水平>
    < ASP:ListItem的>赛1< / ASP:ListItem的>
    < ASP:ListItem的>赛2'; / ASP:ListItem的>
    < ASP:ListItem的>赛第3版; / ASP:ListItem的>
    < ASP:ListItem的>赛4℃; / ASP:ListItem的>
< / ASP:RadioButtonList的>ul.radioButtonList {列表样式:无;保证金:0;填充:0;}
ul.radioButtonList.horizo​​ntal李{显示:内联;}

当repeatLayout是上表:

而当repeatLayout是流量:

有人可以帮我如何设置它,旁边显示的单选按钮文本...如果它的确与众不同在RadioButtonList是在一个表......


解决方案:

这是什么无线电buttonlist看起来像现在:

 < ASP:RadioButtonList的ID =radRace的CssClass =单选按钮列表=服务器RepeatDirection =水平>
    < ASP:ListItem的>赛1< / ASP:ListItem的>
    < ASP:ListItem的>赛2'; / ASP:ListItem的>
    < ASP:ListItem的>赛第3版; / ASP:ListItem的>
    < ASP:ListItem的>赛4℃; / ASP:ListItem的>
< / ASP:RadioButtonList的>

这是CssClass属性:

 <风格类型=文/ CSS>
    .radioButtonList {列表样式:无;保证金:0;填充:0;}
    .radioButtonList.horizo​​ntal李{显示:内联;}    .radioButtonList标签{
        显示:内联;
    }
< /风格>


解决方案

试试这个:

  .radioButtonList标签{
    显示:内联;
}

对我的作品,但如果它不为你工作,那么你可以试试这个解决方案
http://forums.asp.net/t/1089664.aspx/1

他显示输入和标签为块和两个浮标。

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;}

When the repeatLayout is on table:

And when the repeatLayout is on Flow:

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....


SOLUTION:

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>

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>

解决方案

Try this:

.radioButtonList label{
    display:inline;
}

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.

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

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