2013-06-12 1 views
0

af http://dl.dropboxusercontent.com/u/62862049/Screenshots/pf.pngComment reproduire ce fond avec ombre, effet de surbrillance et une couleur non-plat?

J'ai réussi à le reproduire partiellement: J'ai un fond avec bordure arrondie, solide, couleur de fond solide. Je suis bloqué sur les effets: le point culminant sur le dessus - la façon dont la couleur de fond n'est pas uniforme - et le texte et le fond lui-même semble avoir une ombre. Donc, j'ai utilisé jusqu'à présent: border, border-radius, background-color. Comment sont-ils faits?

+0

Vous devez nous donner un exemple de ce que vous utilisez, par exemple avec jsFiddle. –

Répondre

3

Quelque chose comme: http://jsfiddle.net/rEHSL/

Jetez un oeil à la propriété CSS3 box-shadow.

Le CSS pour le gradient de fond est de - http://www.colorzilla.com/gradient-editor/

CSS:

#test { color:#fff; font-size:18px; text-align:center; width:300px; height:100px; background:orange; 


/* Inner and Outer shadows */ 
-webkit-box-shadow: inset 0px 0px 2px 2px rgba(255, 255, 255, 0.8), 
0px 0px 2px 2px rgba(0, 0, 0, 0.2); 

box-shadow: inset 0px 0px 2px 2px rgba(255, 255, 255, 0.8), 
0px 0px 2px 2px rgba(0, 0, 0, 0.2); 

/* rounded corners */ 
-webkit-border-radius: 15px; 
border-radius: 15px; 

/* graident bg */ 
background: rgb(255,175,75); /* Old browsers */ 
background: -moz-linear-gradient(top, rgba(255,175,75,1) 0%, rgba(255,146,10,1) 100%); /* FF3.6+ */ 
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,175,75,1)), color-stop(100%,rgba(255,146,10,1))); /* Chrome,Safari4+ */ 
background: -webkit-linear-gradient(top, rgba(255,175,75,1) 0%,rgba(255,146,10,1) 100%); /* Chrome10+,Safari5.1+ */ 
background: -o-linear-gradient(top, rgba(255,175,75,1) 0%,rgba(255,146,10,1) 100%); /* Opera 11.10+ */ 
background: -ms-linear-gradient(top, rgba(255,175,75,1) 0%,rgba(255,146,10,1) 100%); /* IE10+ */ 
background: linear-gradient(to bottom, rgba(255,175,75,1) 0%,rgba(255,146,10,1) 100%); /* W3C */ 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffaf4b', endColorstr='#ff920a',GradientType=0); /* IE6-9 */