I have a radiobutton and want to show its text as bold.
1) I have tried with
<asp:RadioButton ID="RadioButtonLevel0" runat="server"
GroupName="ItemAccess" value="0" AutoPostBack="true"
oncheckchanged="RadioButton_CheckedChanged"
Text="Only to Me" Font-Bold="true"/>
... But it is still showing the text with normal font-weight.
2) I have tried with
<asp:RadioButton ID="RadioButtonLevel0" runat="server"
GroupName="ItemAccess" value="0" AutoPostBack="true"
oncheckchanged="RadioButton_CheckedChanged"/>
<b>Only To Me</b>
</asp:RadioButton>`
But this is producing an error.
Try out the below code snippet:
<asp:radiobutton ID="rdbText" runat="server" CssClass="bold" Text="Text"></asp:radiobutton>
<style type="text/css">
.bold
{
font-weight:bold !important;
}
Its surly because of CSS..you can also check it..install the firebug or use any developer tool to inspect the element..it will show you which css is overriding it..
I think this can slow your problem..try this.
define a css on your page in which your radio button is than apply this css on your radio button..
<style type="text/css">
.bold
{
font-weight:bold !important;
}
</style>
"!important" will override every thing..
<asp:RadioButton ID="rbtn1" runat ="server" Text ="check1" style="font-weight :bold;" />
I think it is surely because of css of parent control. check with inspect element and know which parent control is cause for this. For example if label is the cause then modify the css class as
.bold > label {
font-weight:bold !important;
}
... This will solve your problem.
use style=>font-weight for making radio button bold:
<asp:RadioButton ID="RadioButton1" runat="server" style="font-weight: 900" Text="test" />
if it doesn't work, it is because of parent CSS. if you have chrome you can use developer tools to see where exactly the Inherited CSS comes from. if you have IE you can use F12 for developer tools. Trace Syle it show you the reason
<asp:RadioButton ID="RadioButton1" GroupName="RadioButton12" runat="server" Text="test1" /><br />
<asp:RadioButton ID="RadioButton2" GroupName="RadioButton12" runat="server" Text="test2" />
<style>
input[type="radio"] + label {
font-weight: normal !important;
color: gray;
opacity: 0.5;
cursor: pointer;
}
input[type="radio"]:checked + label {
color: initial;
opacity: 1;
cursor: pointer;
}
</style>
input[type="radio"] + label {
font-weight: normal !important;
color: gray;
opacity: 0.5;
cursor: pointer;
}
input[type="radio"]:checked + label {
color: initial;
opacity: 1;
cursor: pointer;
}
<asp:RadioButton ID="RadioButton1" GroupName="mygroup" runat="server" Text="test1" /><br />
<asp:RadioButton ID="RadioButton2" GroupName="mygroup" runat="server" Text="test2" />
<span><input id="MainContent_RadioButton1" type="radio" name="ctl00$MainContent$RadioButton12" value="RadioButton1" checked="checked"><label for="MainContent_RadioButton1">Test1</label></span><br>
<span><input id="MainContent_RadioButton2" type="radio" name="ctl00$MainContent$RadioButton12" value="RadioButton2"><label for="MainContent_RadioButton2">Test2</label></span>
Related
Please see aspx page below, I have a text box that I am trying to italicize the placeholder text. Do I use css? I've never really used so if so please show with example. Thanks!
<asp:TextBox ID ="txtMyTextBox" runat="server" ClientIDMode="Static" MaxLength="30" Width="115px" placeholder="Text Box"></asp:TextBox>
So you want to style the place holder of your textbox control. Follow this format to structure it:
::placeholder {
/* your css declarations; */
}
And if you want to style different textboxes differently, you can add styles like below to your textbox.
<style>
.MyTextBox::placeholder {
color:red;
font-style: italic; /*I see you needed an example for italic text*/
}
</style>
<asp:TextBox ID ="txtMyTextBox"
runat="server" ClientIDMode="Static"
MaxLength="30" Width="115px"
CssClass="MyTextBox"
placeholder="Text Box">
</asp:TextBox>
Working Example:
.MyTextBox::placeholder {
color:red;
font-style: italic; /*I see you needed an example for italic text*/
}
<input type="text" class="MyTextBox" placeholder="Hello World"/>
For IE 10-11:
.MyTextBox:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: red;
}
I am using radcombobox to display data, now I am not using any css style for the radcombox, but it still has gray color background.
I want to remove that color.
Below is my rad combobox code :
<telerik:RadComboBox ID="RadCountry" runat="server" CssClass="rcbInput rcbEmptyMessage"
AutoPostBack="False" EmptyMessage="Select a Customer" EnableAutomaticLoadOnDemand="True"
ItemsPerRequest="10" ShowMoreResultsBox="True" EnableVirtualScrolling="True" Filter="Contains" DataTextField="Contact_First_Name"
Font-Names="Arial" Font-Size="11px" ShowToggleImage="false">
</telerik:RadComboBox>
I am also attaching the output of the given code.
i solve this by using below css
<style type="text/css">
div.CustomCssClass .rcbInputCell INPUT.rcbInput {
color: black;
height: 1px;
padding-top: 10px;
}
</style>
Use browser debugger and goto to Inspect Element, find which class / element is the reason for background. Then overwrite css to background:none!important for that element / css rule.
How can i change the fore color of the asp button on disabled mode for IE6 and above
Reference
CSS
[disabled]#DisabledButton
{
color: #933;
background-color: #ffc;
}
Mark Up
<asp:Button ID="DisabledButton" runat="server" Text="Hello Guest"
Enabled="false" />
I have a button on my asp.net page that (upon mouseover) needs to act like a hyperlink (the hand cursor). I cannot use a linkbutton because I need the GUI of a regular asp:button.
Is there a way to create the hyperlink cursor on mouseover?
Thanks
Using css you can say:
.anchor {cursor: pointer; cursor: hand;}
and then in your aspx:
<asp:Button CssClass="anchor" ... >
Use the following for the hand cursor on button mouse over:
<asp:Button ID="Button1" runat="server" Text="Click Me" CssClass="ButtonClass" />
The in a style sheet or inline in the page itself define the class:
.ButtonClass
{
cursor: pointer; cursor: hand;
}
Use both (pointer and hand) for cross browser compatibility.
Add this into your button's markup...
style="cursor: pointer; cursor: hand;"
so...
<asp:Button id="test" text="test" runat="server" style="cursor: pointer; cursor: hand;" />
How can I give spacing between Radio Button and Text using Asp:RadioButton control in ASP.NET?
<asp:RadioButton ID="radio1" runat="server" GroupName="Group1" />
Try:
<asp:RadioButton ID="radio1" CssClass="Space" runat="server" GroupName="Group1" />
and CSS:
.Space label
{
margin-left: 20px;
}
works here...
Use CSS:
input[type="radio"]
{
margin-right: 2px;
}
Or:
input[type="radio"] + label
{
margin-left: 2px;
}
Another method that works is to precede the text property of the radiobutton with the symbol like this Text=" I have pad before me"
where is your text? use a label for the radiobutton or put some margin in CSS around the button.