English 中文(简体)
IE6 positioning issue
原标题:

It works as intended in Safari, Firefox etc. But it is not reading the positioning or z-index in IE6. How can I make it layout as it should in IE6?

Here is the CSS:

.AuthorName_Pic {
    width: 186px;
    position: absolute;
    right: 0;
    bottom: -120px;
    padding: 20px 10px 20px 15px;
    margin: 20px 0 0 0;
    background: url(images/ThumbDark.jpg) no-repeat;
    z-index:100;
}
问题回答

You ll need to address the box model bug. I would use Tantek s solution.

  1. Ensure you are using Standards Mode not Quirks, otherwise the meaning of ‘width’ and ‘height’ is different in IE to other browsers. This is the box model bug as mentioned by Josh, but you don t want to be using a Box Model Hack in this day and age (especially not Tantek s original-and-still-the-worst ugly one). BMHs were needed for IE5 but today are dead and buried, as Standards Mode fixes that issue and a lot more.

  2. You say the z-index is wrong in some way. There isn t enough information to say for sure since you have only posted a small part of your code, but a common source of this problem is that IE sets a default ‘z-index’ stacking context on any element you give a ‘position’ (relative/absolute) even when you don t include the z-index attribute. Ensure all the elements you have positioned are also z-indexed to ensure consistent layout cross-browser.





相关问题
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....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

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 ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签