2013-07-01 36 views
0

我不明白爲什麼它不能在IE9和IE10上工作。它適用於其他瀏覽器,但不適用於那些瀏覽器。這裏是我的問題::之前元素錯位

s http://d.pr/i/QNwi.jpg

.briefing h3 { 
    margin-bottom: 23px; 
    border-bottom: 3px double #9f9c9b; 
    position: relative; 
    padding-bottom: 22px; 
    padding-left: 40px; 
} 

.briefing h3:before { 
    content: url('../img/general-title-decoration-white.svg?1370978950'); 
    width: 25px; 
    display: block; 
    top: 2px; 
    left: 0; 
    position: absolute; 
} 

我還使用了字幕裝飾主頁上這種技術。除了它的工作原理:

http://d.pr/i/irsT.jpg

與此代碼:

.special-title { 
    font-size: 24px; 
    color: #a4a19e; 
    line-height: 1.2; 
    position: relative; 
    padding: 8px 0 8px 38px; 
    border-top: 1px solid #e2dbcf; 
    border-bottom: 1px solid #e2dbcf; 
    margin-top: 49px; 
    margin-bottom: 25px; 
} 

.special-title:before { 
    content: url('../img/general-title-decoration.svg?1369571463'); 
    position: absolute; 
    width: 28px; 
    height: 28px; 
    left: 0; 
    top: 10px; 
} 

我想看看的差異,但我不明白這一點。

此外,僞元素沒有出現在我的控制檯上的IE瀏覽器,所以它有點難以測試(尤其是使用瀏覽器)。

任何想法?我卡在那裏。

Here is the page where the problem appears

And the page where it doesn't

非常感謝你。 :)

+0

作爲一個方面的評論,我看到你正在尋找實習機會,而我的公司(在布魯塞爾)經常接受學員:www.mccann.be ;-) –

+0

@Bartdude在stackoverflow的階段提供?不知道這是展示我技能的最佳地點,但謝謝!我會檢查一下:) – Naemy

+0

尋求幫助沒有顯示出弱點,特別是如果問題得到很好的解答。我會更關心那些假裝他們從學校裏知道所有事情的人,或者無法表明自己有任何反思的跡象。 –

回答

0

您是否嘗試過不定位:before元素absolute? 只要你沒有定義display:block;

它應該定位得很好沒有它,而且,這兩種情況的區別在於你在第一種情況下設置了display:block;

+0

它的代碼大小設置爲100%,所以如果我沒有設置display:block,它會佔用整個容器。是的,只是注意到了!我會嘗試沒有。謝謝:) – Naemy

+0

糟糕,沒有看到它是一個SVG。祝你好運,讓我知道結果。 – maartenmachiels

+0

好吧,我試圖刪除顯示:塊並沒有改變。我不知道問題來自哪裏.. – Naemy

0

我無法測試這個,但嘗試使用::before,這在CSS3中顯然是新的。

相關問題