2011-07-22 47 views
10

pregunta realmente aficionados aquí - fondo cuerpo gradiente no está funcionando en cromo, muy extraño, lo he intentado:Google Chrome fondo gradiente

background: -webkit-gradient(linear, 0 0, 0 bottom, from(#FFF), to(#000)); 

Y

background: -webkit-gradient(linear, 0%, 0%, 0%, 100%, from(#fff), to(#000)); 

Y

background: -webkit-gradient(linear, center top, center bottom, from(#fff), to(#000)); 

Todo fue en vano! Funciona en cualquier otro navegador ...

+0

Aquí es degradado último generador funciona muy bien, y correcciones de compatibilidad para todos los navegadores http://www.colorzilla.com/gradient-editor/ –

Respuesta

19

Ha intentado:

background: -webkit-linear-gradient(#917c4d, #ffffff); 

WebKit actualiza para que coincida con la sintaxis de especificaciones, por lo que debe have this to get maximum browser support:

background: -webkit-gradient(linear, center top, center bottom, from(#917c4d), to(#ffffff)); 
background: -webkit-linear-gradient(#917c4d, #ffffff); 
background: -moz-linear-gradient(#917c4d, #ffffff); 
background: -o-linear-gradient(#917c4d, #ffffff); 
background: -ms-linear-gradient(#917c4d, #ffffff); 
background: linear-gradient(#917c4d, #ffffff); 
+0

Gracias por sus respuestas chicos, sin embargo, el culpable fue una Falta el significado de clearfix. La altura del cuerpo era 0. ¡Sin embargo, usaré tus publicaciones como referencia y para este proyecto! Robertc - ¡gracias por hacer el esfuerzo de hacer eso por mí! – rickyduck

+0

** Para IE: ** 'Filtro: progid: DXImageTransform.Microsoft.gradient (startColorstr = '# 917c4d', endColorstr = '# ffffff');' [Más información aquí.] (Http://webdesignerwall.com/ tutoriales/cross-browser-css-gradient) – OammieR

1

Has probado esto:

<style> 
.myawesomegradient{ 
background:-webkit-gradient(linear, left top, right top, color-stop(0%,#ffffff), color-stop(100%,#000000)); 
} 
</style> 

deben trabajar en Safari y Chrome ...

1

La etiqueta de degradado lineal CSS3 ahora es compatible con todos los principales navegadores.

La sintaxis requiere una adicional to. Por lo tanto, en lugar de, p. center top, left top etc. uso, por ejemplo to top como

background-image: linear-gradient(to top , #094F86, #4EABDB);