我有兩個div都對他們的相對位置。內部div已經離開和頂部位置。它們在所有瀏覽器中都能正常工作,除了IE7以外,它的左側位置需要減少大約100px。我想知道如果我可以解決這個問題,而不必有一個IE特定的樣式表。 下面是代碼相對定位不同出現在IE7中比其他瀏覽器
<div style="position:relative;"> <div class="edit-photo-div"> <a href="#"> <span class="edit-photo-icon">Edit</span> </a> </div> </div>
和我的CSS:舊版本的IE之前
> .edit-photo-div {
background-image: url("/images/editphoto.png");
background-position: 9px 6px;
height: 28px;
left: 143px;
position: relative;
top: -27px;
width: 35px;
margin-bottom:-29px;
overflow:hidden;
}
.edit-photo-icon{
padding-left:35px;
position:relative;
top:6px;
color:#7c7c7c;
font-weight:bold;
}
你能告訴你在視覺上試圖實現什麼? – 2013-04-23 18:28:30
這是IE7中的錯誤。 background-positions根據外邊框而不是填充邊緣。 – Rob 2013-04-23 18:33:05
附圖片 – user1404536 2013-04-23 19:38:59