2013-05-08 22 views
0

某些webmail客戶端會截斷內聯樣式中的空格。例如該代碼webmail客戶端截斷內聯樣式

style="display: inline; float:right; font-size:16px; 

呈現爲

style="display:inline;float:right;font-size:16px; 

在這一點上並沒有受到傷害。但是,當我加一些背景花式,我的佈局崩潰:

來源:

background:#ff6600 url('http://localhost:8080/path/to/img.png') no-repeat top right; 

呈現:

background:#ff6600url('http://localhost:8080/path/to/img.png')no-repeattopright; 

你有什麼想法如何避免這種情況?可能類似於「& n b s p;」 ?

歡呼聲, 梅奧

回答

1

我推薦這

<div id="test" style="background:#ff6600; background-image:url('http://www.emofaces.nl/nl/emoticons/z/zwart-en-wit-emoticon.gif'); background-repeat:no-repeat; background-position:bottom left;"></div> 

看到這裏的工作例如: http://jsfiddle.net/DennisBetman/QTLBg/

+1

爲伊泰加你寫後,我也用背景位置-x和背景的位置-Y提供了一個小的提升。 – mayo 2013-05-08 14:28:52

0

正如我之前推薦的,你可以分離的樣式。我用background-position-xbackground-position-y

See the code here

+0

我同意你的意見,謝謝! – mayo 2013-05-08 14:28:03