Link to home
Start Free TrialLog in
Avatar of stellaartois
stellaartoisFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Alignment of buttons (HTML, CSS)

Hello all,

Please refer to this web address:
http://www.makeaquiz.net/help/

The page is fine in Firefox, but not in IE.  I'm using version 9 of IE, however it doesnt seem to change between IE versions.

As you can see, I have two buttons underneath the text box.  I want them both centered with a 5px gap inbetween.

I just cant for the life of me, get the image buttons to display in the center side by side.

If I reduce the width of the <li> tag to the total with of the two images + 5px margin, the explore button just falls below in IE.

Does IE add extra margin to image buttons or something?

Thanks for any assistance,

Luke
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

It would help it you could post your html and your CSS. But just looking at it (looks perfect with google chrome) I would put a div around both buttons and make the div the same width as the white box above it. Make it "position:relative; but don't float it. Then create a packing div inside that one (empty of content) so it fills the gaps up to the left of the first button. Float this div left. Create a 5px width div to make the gap and float it left then finish with the 2nd button also floated left. With IE, anything small like 5px in height or width you should also give it a font-size:0px and line-height:0px; because Explorer likes to widen these small divs due to it's minimum font size. See if these suggestions help
Hmmm, asking for html and css when you clearly still had access to the linked page!! I probably would've been able to solve the issue with that, but since the link leads to a 404, I guess it's been resolved?

Let's do some deductive reasoning. You mentioned 'Does IE add extra margin to image buttons' and Elvin mentions 'Make it "position:relative; but don't float it'. So I'm going to guess you were using float. IE has a double-margin bug on floated elements, which could account for your issue. Apply 'zoom: 1;' to the floated elements to force 'hasLayout' and that bug will be taken care of. Of course, I am just shooting in the dark here :)
Viewing the source of the HTML doesn't show linked CSS so that's why I suggested posting it.
ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Kravimer Damn, I'm getting sloppy, you're so right!

@elvin66 Use firebug/ie developer bar/Safari with dev enabled/Chrome to inspect the page, that'll give you all the CSS info you need... Use any modern browser (perhaps even IE) to save the entire page, it'll include all CSS. A working live example page is so much easier to work with...
Thanks mreuring
Perhaps hearing a comment from the author would be nice?