Question

As the title says, I'm trying to find a way to add a text-shadow effect for a bullet. I'm using text-shadow to show a light glow behind some text, and I'd like to accomplish this same effect for bullets without having to create my own bullet image.

Was it helpful?

Solution

try this

ul {
  list-style: none;
}

li:before {
  content: '\2022';
  padding: 10px;
  text-shadow: 1px 1px 2px red;
}

http://jsbin.com/apoviv/2/edit

UPD: You really can use unicode charachtest for special symbols this is quite tricky but there is good article which can help http://css-tricks.com/css-content/

OTHER TIPS

Your best bet would be to use pseudo-element to insert a bullet and a bullet symbol ( or any other that would fit you). Since it would be a textual content, the text-shadow would work perfectly on it

Here is an example — http://dabblet.com/gist/4356335 — with a bit of extra styles to make the inserted bullet work.

Another option would be to to use pure CSS bullets. Something like this:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
            <title>CSS Bullets</title>
        <style type="text/css" media="screen">

            html, body {
            font-size: 16px; 
        }

        article ul li {
            position:relative;
            overflow:hidden;
            list-style:none;
            padding-left:20px;
            line-height: 1.35em;
            margin: 0 0 .5em 0;
        }

        article li:before {
            margin:-8px 0 0;
            background:#ededed;
            overflow:hidden;
            list-style:none;
            content:"";
            position:absolute;
            top:0.95em;
            left:0;
            width:7px;
            height:7px;
            border-radius:2px;
            -webkit-border-radius:2px;
            -moz-border-radius:2px;
            box-shadow: 1px 1px 5px #888888;
        }
        </style>
    </head>
<body>
    <article>
        <ul>
            <li>Bullet 1</li>
            <li>Bullet 2</li>
            <li>Bullet 3</li>
        </ul>
    </article>
</body>
</html>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top