tags:

views:

40

answers:

1

Hello, due to a problem we are encountering with asp.net (see: asp.net 4.0 Random posting behavior) we need to style asp:button controls (that of course resolve to <input type=submit> tags) using the sliding door technique.

We originally had <button><span>text</span></button> sets but because of the above issue we need to move to asp:Button controls.

You cannot put a <span> tag inside of an asp:button control, so working it like the above will not work.

I got it to work only in IE8 by wrapping the button with a div using "display: inline-block". But it fails in IE7, so this is not a solution for us. It needs to work in both IE7 & IE8 (Firefox would be great, but in not required)

+1  A: 

To fix display: inline-block; for IE6-7 you can try

<div class="button"><input type="submit" /></div>


.button {
   display: inline;
   display: inline-block;
   zoom: 1;
}

(These styles are correct almost for any time you want simulate inline-block in all browsers)

fantactuka
Thanks, but as noted in the above question, I cannot use the <button> tag. It must be the asp:Button control that resolves to the <input type=submit> tag
saunderl
Ok, so you can wrap your input with inline-block element. It does not metter. Check edited answer
fantactuka
Right, that is exactly what I said I tried in my original text, but it fails in IE7 - Please re-read original question
saunderl
..."I got it to work only in IE8 by wrapping the button with a div using "display: inline-block"."... Right, but if you'll add `display: inline;` before `display: inline-block;` and `zoom: 1;` - that will fix IE7 issue with inline-blocks - they will work properly. Just have a try.
fantactuka
I apologize - I cannot test this until Monday. But I will put it to the test first thing in the morning. I really hope this works
saunderl