English 中文(简体)
Why is ie7 ignoring the left-margin on my first list item (only)?
原标题:

http://blog.helpcurenow.org/test/mockups/mar2010/lp.html

In the above landing page, I have an offers box that has four donation buttons. The first three are targeted with individual id s and given a left margin of 13px.

All is well in every browser I m viewing in except ie7. For some reason ie7 is ignoring the left-margin of 13px on the first list item, and only on that one.

The strange part is when I open ie s developer tools (not actually viewing in ie7, but using ie8 in ie7 mode) and select the element, it shows that the 13px margin is there, and not crossed out. The browser just seems to be ignoring it!

Is there some ie7 quirk I should know about here or did I miss a CSS declaration I should have added? Any ideas??

Thanks!

最佳回答

Try setting the padding on the ul that houses those lis to 10px 13px, then remove the margin-left from the lis.

问题回答

Just clear the wrong borders, line-heights and box-models and you are safe.

in the top first line of your CSS, you just add:

html,body,h1,h2,h3,h4,h5,h6,p,ul,li,img {border:none;padding:0;margin:0; /* etc. like font-size:10px;line-height:10px; */}

then you can set the "wanted" values on each item afterwards: further more you can set

display:block;

on your elements then they will use the same box-model. IE6/IE7 does not understand inline-block which is default for some elements I believe.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签