Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Putting css borders around radio buttons

Tags:

css

I'm trying to get a garish red border around some radio buttons, but it is not showing up in Firefox latest or Chrome latest. Work fine in IE9/IE8.

Each of the input element on my form that are required has a data-val-required attribute put in by MVC3. All browsers puts in the red borders just dandy when we have a text or textarea inputs, but am struggling with the radio button. For IE, it works, but other browsers won't put the red border around it.

css:

input[data-val-required], select[data-val-required], textarea[data-val-required]
{
    background-color: #F0FFFF;
    border: 1px solid red;
}

view-source:

<label for="WaiveSelect">Do you waive confidentiality?</label><br />
<input data-val="true" data-val-number="The field WaiveSelect must be a number." data-val-required="Please select waive." id="WaiveSelect" name="WaiveSelect" type="radio" value="0" /> No, I do not waive confidentiality<br />
<input id="WaiveSelect_2" name="WaiveSelect" type="radio" value="2" /> Yes, I waive confidentiality<br />
<input id="WaiveSelect_3" name="WaiveSelect" type="radio" value="3" /> Yes, I waive confidentiality except to the client<br />
<span class="field-validation-valid" data-valmsg-for="WaiveSelect" data-valmsg-replace="true"></span>

What it looks like in IE (Firefox and Chrome shows no borders): enter image description here

like image 524
Robert Koch Avatar asked Jun 01 '12 11:06

Robert Koch


People also ask

Can you add borders in CSS?

The CSS border properties allow you to specify the style, width, and color of an element's border.


1 Answers

input[type=radio]{
    outline: 1px solid red
}
like image 119
jcleve Avatar answered Sep 23 '22 23:09

jcleve