{"id":14115,"date":"2011-09-06T18:44:22","date_gmt":"2011-09-07T01:44:22","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=14115"},"modified":"2023-01-27T06:08:02","modified_gmt":"2023-01-27T14:08:02","slug":"text-shadow","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/t\/text-shadow\/","title":{"rendered":"text-shadow"},"content":{"rendered":"\n
p { \n  text-shadow: 1px 1px 1px #000;\n}<\/code><\/pre>\n\n\n\n

You can apply multiple text shadows by comma separating<\/p>\n\n\n\n

p { \n  text-shadow: 1px 1px 1px #000, \n               3px 3px 5px blue; \n}<\/code><\/pre>\n\n\n\n

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:<\/p>\n\n\n\n

1. value = The X-coordinate
2. value = The Y-coordinate
3. value = The blur radius
4. value = The color of the shadow<\/p>\n\n\n\n

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).<\/p>\n\n\n\n

The third value, the blur radius, is an optional value which can be specified but don\u2019t have to. It\u2019s the amount of pixels the text is stretched which causes a blur effect. If you don\u2019t use the third value it is treated as if you specified a blur radius of zero.<\/p>\n\n\n\n

Also, remember you can use RGBa<\/a> or HSLa<\/a> values for the color, for example, a 40% transparency of white:<\/p>\n\n\n\n

p { \n  text-shadow: 0px 2px 2px rgba(255, 255, 255, 0.4); \n}<\/code><\/pre>\n\n\n

Examples<\/h3>\n\n\n