views:

490

answers:

4

I'm having a problem with getting my radio buttons laid out (and checkboxes) correctly in IE8 .. Firefox, Chrome, Opera all working however ..

Here is a screenshot of the problem

IE8 problem

The code is below:

<label for="AdditionalResponses_0__Response" id="AdditionalResponses_0__Response_Label">Single answer</label>
<div class="row " id="AdditionalResponses_0__Response">
  <input id="AdditionalResponses_0__Response_one" name="AdditionalResponses[0].Response" type="radio" value="one" />
  <label for="AdditionalResponses_0__Response_one" id="AdditionalResponses_0__Response_one_Label">one</label>
  <input id="AdditionalResponses_0__Response_two" name="AdditionalResponses[0].Response" type="radio" value="two" />
  <label for="AdditionalResponses_0__Response_two" id="AdditionalResponses_0__Response_two_Label">two</label>
  <input id="AdditionalResponses_0__Response_three" name="AdditionalResponses[0].Response" type="radio" value="three" />
  <label for="AdditionalResponses_0__Response_three" id="AdditionalResponses_0__Response_three_Label">three</label>
  <input id="AdditionalResponses_0__Response_four" name="AdditionalResponses[0].Response" type="radio" value="four" />
  <label for="AdditionalResponses_0__Response_four" id="AdditionalResponses_0__Response_four_Label">four</label>
</div>

Sorry for the one long line, but that's how I got it through the source..

Here is the CSS:

.row input (line 471)    
{
float: left;    
display: inline;    
width: 16px;    
height: 16px;    
margin-top: 0pt;    
margin-right: 5px;    
margin-bottom: 0pt;    
margin-left: 0pt;    
}

.row label (line 479)
{    
float: none;    
font-weight: normal;    
font-size: 12px;    
line-height: 16px;    
}

div.panes label (line 70)    
{    
font-size: 95%;    
font-weight: bold;    
color: #222222;    
line-height: 150%;    
padding-bottom: 3px;    
display: block;    
}
A: 

Try removing the height or float from .row input. Avoid adjusting the line-height if you can, as well.

Sonny Boy
I've tried that with no luck..
Kevin
doing that just puts everything in block format with the labels on top of the radio buttons ..
Kevin
A: 

Looks like another case of IE Stepdown: Preventing Menu Stepdown

Austin Fitzpatrick
I've tried adding display:inline to the Row element
Kevin
and the row input and the row label ... doesn't have any effect
Kevin
A: 

Are you trying to align them vertically or horizontally?

If vertically, add this to your css

.row label {
    display: block;  
}

and change your markup so that your inputs are wrapped by the labels. You wouldn't have to use the for="" attribute this way.

<label>
    <input id="AdditionalResponses_0__Response_one" name="AdditionalResponses[0].Response" type="radio" value="one" />
    one
</label>

If horizontally, add

.row input, .row label {
    float: left;  
    display: block;  
}
washwithcare
A: 

Im not sure but - did you try the clear property?
in your case the value would be left i think
w3 source

Knu
so I added the clear:both and this is what I came up with .. http://tinypic.com/r/72f4tw/6
Kevin
ok wer almost there now you can either style your labels to re-align them correctly or you could put your inputs inside their respective labels - which is valid (in the right order - text last)
Knu
What style would you suggest? I've tried fiddling with padding, and line height but neither really do the trick ..
Kevin
did you try putting the inputs inside the labels firt? // <label for="example"><input type="radio" id="example" />one</label> // if you wanna style instead you should try playing with inline/block and margin/padding/line-height // maybe you should clear the labels too
Knu
I haven't tried the label around the input - only because of the way it's being written in .netI did add a padding-top: 5px to Label though and it seemed to work (in IE) however it pushed off everything in Chrome and FFox - doh!
Kevin
well now you just need to conditional comments to isolate IE css or use css hacks to target a specific version of IE // http://www.quirksmode.org/css/condcom.html // using <br /> is another solution // problem solved? accept my answer :)
Knu