SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation text-shadow trouble...

    I'm new to the area of CSS. I'm playing around with it and for some reason I can't get the text-shadow property to work. I have the following in a css file:

    h1 { font-size: 24; color: white; text-shadow: #CCCCCC 3px 3px 5px; }

    Now when I put an h1 header in my html file, it shows up white and with a size of 24, but no shadow.

    Any ideas?

    Much thanks,

    Bill

  2. #2
    SitePoint Addict jough's Avatar
    Join Date
    Sep 2001
    Location
    You have moved into a dark place. It is pitch blac
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Bill,

    Unfortunately, no major browser on the market today supports the text-shadow property.

    Here's a link to a compatibility chart for browser support of various CSS text properties:

    http://www.westciv.com/style_master/...port/text.html

    As you can see, text-shadow is one of the few properties not supported. Hopefully the version 7 browsers will support this property, but that means it'll take YEARS until this is available for practical use (since it takes YEARS for people to upgrade their web browsers)

    You *can* fake it out a little, however.

    With positioned elements (using the position: property) you can specify a z-index, which will allow you to put one element (piece of text, in this case) on top of another, thus offsetting the shadow a bit.

    While I was thinking of how to better describe this, I just went ahead and made a page demonstrating it:

    http://www.jough.com/layout/text-shadow.html

    You can "View | Source" in your browser to see the code (there's not too much to it - and everything is on one page).

    By changing the offset and the shadow colour, you can have some pretty cool shadow-like effects, if you're willing to give up a certain "fuzziness".

    Let me know how it works for you.

    Cheers,

    -- Jough
    My Dynamic Site in Action:
    Poetry X Poetry Archive

  3. #3
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile It figures! The one thing I'd like to use...

    That's a great workaround though. Thanks so much for all your help Jough!

    Bill


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •