Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Alignment of buttons (HTML, CSS)

Posted on 2011-03-11
7
Medium Priority
?
325 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:stellaartois
  • 4
  • 2
7 Comments
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35107516
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
0
 
LVL 17

Expert Comment

by:mreuring
ID: 35115550
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 :)
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35124583
Viewing the source of the HTML doesn't show linked CSS so that's why I suggested posting it.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 43

Accepted Solution

by:
David S. earned 1000 total points
ID: 35124644
> 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.

Martin, the fix for that bug is giving "display:inline" to the floated elements. (http://www.positioniseverything.net/explorer/doubled-margin.html)

Also floated elements automatically get "hasLayout".
0
 
LVL 17

Expert Comment

by:mreuring
ID: 35127267
@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...
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35132151
Thanks mreuring
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35132166
Perhaps hearing a comment from the author would be nice?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question