i have tried below css to show image in radio button, but following css is not working.please help.
我已经尝试过以下css在单选按钮中显示图像,但是以下css不起作用。请帮忙。
.RadioButton
{
background-image: url(../images/radio.png);
}
<asp:RadioButton ID="RadioButton1" runat="server" CssClass="RadioButton"/>
2 个解决方案
#1
0
You cannot style a radio button with CSS alone as their appearance is determined by the OS, not the browsers. You will have to use a Javascript plugin to allow it.
您不能单独使用CSS设置单选按钮的样式,因为它们的外观由操作系统而不是浏览器决定。您将不得不使用Javascript插件来允许它。
As you can see here, the image is loaded within the <img>
tag, but not as a background image for the radio button.
正如您在此处所看到的,图像将加载到标记内,但不会作为单选按钮的背景图像加载。
You can use a plugin like this one to be able to style these elements.
您可以使用像这样的插件来设置这些元素的样式。
#2
0
there are a lot of jquery plugin for radio btn and drop list try this link
有很多jquery插件的无线电btn和下拉列表尝试此链接
http://screwdefaultbuttons.com/
http://screwdefaultbuttons.com/
:)
:)
#1
0
You cannot style a radio button with CSS alone as their appearance is determined by the OS, not the browsers. You will have to use a Javascript plugin to allow it.
您不能单独使用CSS设置单选按钮的样式,因为它们的外观由操作系统而不是浏览器决定。您将不得不使用Javascript插件来允许它。
As you can see here, the image is loaded within the <img>
tag, but not as a background image for the radio button.
正如您在此处所看到的,图像将加载到标记内,但不会作为单选按钮的背景图像加载。
You can use a plugin like this one to be able to style these elements.
您可以使用像这样的插件来设置这些元素的样式。
#2
0
there are a lot of jquery plugin for radio btn and drop list try this link
有很多jquery插件的无线电btn和下拉列表尝试此链接
http://screwdefaultbuttons.com/
http://screwdefaultbuttons.com/
:)
:)