2011-10-08 66 views
6

所以我有一些簡單的風格here previosly Chrome的渲染它一樣FF - 這樣Google Chrome中的文字陰影發生了什麼?

soft FF 4 rendering

和遍佈突然我期待我在Chrome的文檔,看看這個

enter image description here

所有陰影都不透明=(如何處理tham - 如何修復?

enter image description here

CSS code

body{padding: 5px;background-color: #FFF;font: 100.01% "Trebuchet MS",Verdana,Arial,sans-serif} 
h1,h2,p{margin: 0 10px} 
h1,h2{font-size: 250%;color: #FFF; text-shadow: 0px 1px 1px #000;} 
h2{font-size: 120%;} 
div#nifty{ margin: 0 1%;background: #9BD1FA} 
b.rtop, b.rbottom{display:block;background: #FFF} 
b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background: #9BD1FA} 
b.r1{margin: 0 5px} 
b.r2{margin: 0 3px} 
b.r3{margin: 0 2px} 
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px} 
p{color: #000;text-shadow: 0px 1px 1px #fff;padding-bottom:0.3em} 
input[type="button"], .eButton {width: 150px;padding: 5px 10px;word-wrap: break-word;height: auto;}} 
::-moz-selection { background-color: #fbfdfe; color: #ff6c24; text-shadow: 0px 1px 1px #258ffd;} 
::selection { background-color: #fbfdfe; color: #fff; text-shadow: 0px 1px 1px #258ffd;} 
+0

在OS X 10.7的Chrome 14.0.835.202&16.0.903上看起來很好。 –

+0

Windows Chrome 14.0.835.202 m給我帶來了問題,16.0.903.0 canary以一種非常奇怪的方式工作 - 首先它以不好的方式渲染它,但在很短的時間內它將它變成可變的FF。 – Rella

+0

XP上的Chrome 15.0.874.83 beta-m對我來說有同樣的問題。另外,你拼寫輸入爲'inpuut'。 – Eric

回答

1

如果您正在尋找半透明陰影,您可以嘗試使用RGBA值,而不是十六進制值。所以它會是:

h1 { text-shadow: 1px 1px 1px rgba(0,0,0,.20); } 

其中前三個數字是RBG值(紅,綠,藍)和第四個數字是不透明度(從0到1)。所以上面的例子是黑色的,不透明度爲20%。

而且,奇怪的影子重量似乎是從上text-shadow模糊值到來。當我將其更改爲1px 1px 0時,它會提供比0px 1px 1px更均勻的陰影。不知道爲什麼。