Posted By

JimSangwine on 05/05/11


Tagged


Versions (?)

CSS Text Shadow


 / Published in: CSS
 

  1. /* Regular text shadow: */
  2.  
  3. p { text-shadow: 1px 1px 1px #000; }
  4.  
  5. /* Multiple shadows: */
  6.  
  7. p { text-shadow: 1px 1px 1px #000, 3px 3px 5px blue; }
  8.  
  9. /* The first two values specify the length of the shadow offset. The first value specifies the horizontal distance and the second specifies the vertical distance of the shadow. The third value specifies the blur radius and the last value describes the color of the shadow:
  10.  
  11. 1. value = The X-coordinate
  12. 2. value = The Y-coordinate
  13. 3. value = The blur radius
  14. 4. value = The color of the shadow
  15.  
  16. Using positive numbers as the first two values ends up with placing the shadow to the right of the text horizontally (first value) and placing the shadow below the text vertically (second value).
  17.  
  18. The third value, the blur radius, is an optional value which can be specified but don’t have to. It’s the amount of pixels the text is stretched which causes a blur effect. If you don’t use the third value it is treated as if you specified a blur radius of zero.
  19.  
  20. Also, remember you can use RGBA values for the color, for example, a 40% transparency of white: */
  21.  
  22. p { text-shadow: 0px 2px 2px rgba(255, 255, 255, 0.4); }

Report this snippet  

You need to login to post a comment.