Solved

Alignment of buttons (HTML, CSS)

Posted on 2011-03-11
7
305 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 42

Accepted Solution

by:
David S. earned 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now