I am a limited knowledge in html and css. Please excuse if it is a silly question. I have tried in different ways, but could not solve this issue.
http://teddyslist.com/dev/register.php
At the bottom of the page, there is a radio button saying "Preferred mode of contact".
<input type="radio" name="preferredcontact" value="P"> Phone
<input type="radio" name="preferredcontact" value="E"> Email
Radio buttons are showing in Firefox and even on IE. But they are not showing in Chrome and Safari. It is very strange to me. I think there is some conflict in CSS.
When I inspected your code, I could see that you have a style -webkit-appearance: none; that is specified for input, textarea, button in realsite.css
The CSS is as follows
input, textarea, button {
-webkit-appearance: none;
-webkit-font-smoothing: antialiased;
resize: none;
}
To make the radio buttons visible, either remove -webkit-appearance: none; from the CSS OR add a style as below
input[type="radio"]{
-webkit-appearance: radio;
}
Here is a screenshot
I realize that this post does not mention Bootstrap CSS as a keyword or tag but one thing I would mention is that if you are having the exact same result which is that the radio buttons do not show up in Chrome but are present in Firefox and IE, but, you are also using Bootstrap CSS then you will want to ensure that you do not have the class name "form-control" on the radio button input tag specifically. Essentially, you can use the class name "form-control" on every other form element type except the radio button input type. Using that class "form-control" on a radio button tag makes it disappear therefore just remove the class attribute and the radio button will appear. At first I thought this was a Chrome issue but found the radio buttons would appear when I removed the reference to the Bootstrap CSS.
If you use :
input{
display:none;
}
then radio button will not be displayed.
By default it takes the value display: none;
Change it to:
input{
display: inline;
}
and it will be visible.
You have
-webkit-appearance: none;
set on checkboxes and radio. You need to style the checkboxes for them to appear, or simply get rid of the appearance: none
How to style checkbox using CSS?
Related
Consider this checkbox:
<input type="checkbox" />
When pressing a keyboard button when this checkbox is focused, a solid black outline appears around it. I can get rid of by removing the outline:
input {
outline: none;
}
<input type="checkbox" />
However, I wish to apply an outline to the actual element, and this method would invalidate it. I was wondering if there was a pseudoclass that could be used to select this checkbox state. If so, what is it called and how do I access it? If not, is there any other viable way (CSS only) to do achieve this? I thought the :focused pseudoclass would work, but this selects the focused state of the checkbox and not whatever this state is, when the checkbox is focused and a key is pressed.
P.S. when I add an outline to the checkbox, the problem appears in a different format. The outline is somehow "extended", almost as if a padding or border was added to the element (try focusing on the following checkbox and pressing a key):
input {
outline: solid red 3px;
}
<input type="checkbox" />
I think outline-offset: 0px; under the element state focus-visible is what you're looking for:
input {
outline: solid red 3px;
}
input:focus-visible
{
outline-offset: 0px;
}
<input type="checkbox" />
The checkbox is an HTML element used to take input from the user. This HTML element is generally used on every website, but without styling them, they look similar on every website.
I have used some Checkboxes and Radiobuttons in site. On Zooming size of Radio Buttons and Checkboxes is getting increased in IE and Chrome.
To increase size of Radio Buttons and Checkboxes in Mozilla Firefox I have used this CSS:
input[type="radio"]
{
-moz-appearance: none;
}
input[type="checkbox"]
{
-moz-appearance: none;
}
But the problem is that with this CSS Radio buttons are not reflecting properly, semi-circle part of radio button is reflecting without border.
Is there any way to fix this. Issue is reflecting only in Mozilla. Please suggest any alternative way to zoom size in Mozilla.
I am unable to post complete HTML here.
There is also a Ticket here:
https://bugzilla.mozilla.org/show_bug.cgi?id=400364
*{
outline: none;
}
try this...
In my application I am showing a graph with legends. Legends have colored checkboxes. Below is code for a checkbox that works fine in IE but the color does not appear in Chrome and Firefox
<input type="checkbox" style="background-color:#d65aef;">
Please tell me what should I do so that it works in IE,Chrome and Firefox. I have to use the hex color as used in the given code.
Form controls like checkbox, radio, select and etc using a platform-native styling based on the operating system's theme. You can reset it by using -moz-appearance and -webkit-appearance properties. But this properties will also reset sizes of control and may be something else, so you will need to add width/height manually:
input[type=checkbox] {
background: red;
-webkit-appearance: none;
-moz-appearance: none;
height: 16px;
width: 16px;
}
Also for checkbox you need to provide a checked state render:
input[type=checkbox]:checked {
background-image: url(/*custom checked icon url*/);
}
Close input into span (or div) and set span color.
<span style="background-color:#d65aef;"><input type="checkbox" class="base" name="w3wp" style="background-color:#d65aef;" value="w3wp" checked="" onclick="legendChanged();" alt="fd" title="w3wp"></span>
I have a simple div that if clicked to much turns blue: JsFiddle
In Chrome its worse, the whole div(30x30px + some other surounding elements) turns blue. Is there anything I can do about this (other than using img)?
Sorry for asking, but isn't this just you marking it by double-clicking it? The "blue" highlight effect would be the normal behaviour in all browsers...
If you do not want this behavior, you should make sure it is not selectable by applying styles:
-moz-user-select: none;
-webkit-user-select: none;
Updated:
For Internet Explorer, use the unselectable tag on your div:
<div class="right" unselectable="on">»</div>
This CSS will do the trick:
div::selection {
display:none;
}
It sets the selection (highlight) to display:none, so you don't see it.
i am using this css code for hover color for the text area and inputs it works fine in all browsers except IE its show like the image below. How to set the radio button background only to transparent.
my css code:
input:focus, input:hover, textarea:focus, textarea:hover {
border: 0 none;
background: blue;
}
Since you're styling input directly, radiobuttons and checkboxes will also be targeted. An easy way to avoid that is to use the :not() selector like so: input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=image]):not([type=button]):focus. Note that this doesn't work in IE<8(?) though.
powerbuoy is right about that the input selector select checkboxes and radios in addition to the normal text boxes.
but i have a suggestion that you can use instead of his that will work in more browsers.
basically you can add a class to all your checkbox and radio buttons inputs.
so your checkbox and radio html becomes
<input type="checkbox" class="checkbox">
<input type="radio" class="radio">
and then add the css to reset the style for the checkboxes and radios like that
input.checkbox, input.radio
{
background:transparent;
}