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.
Text-shadow or similar effect to a <ul> bullet?
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/
this creates a shadow, but instead of the bullet i get a question mark block. is there another syntax or declaration for that simple bullet? –
Making
yes, this should be tricky one. I did just quick copy paste, you probably could look for
text symbols
–
Nauplius okay not such a disaster at all, there is another interested related article alanhogan.com/tips/css/special-characters-in-generated-content –
Nauplius
well, It doesn't seem to work with the hex for a bullet. im trying content: "\u2022"; . Also, I tried it with the symbol from the example, and it did work but the symbol did not have a text-shadow applied to it –
Making
@ejfrancis, this is strange, it works both on me. Actually it suppose to be
'\2022'
no letter u
only numbers –
Nauplius bw what browser you testing on caniuse.com/css-textshadow make sure it supports
text-shadow
–
Nauplius got it! the symbol wasn't shadowed because I was overwriting that css rule later on by accident. thanks for the help! –
Making
yep, you are welcome, my peasure, if any chance to accept answer? that makes me even happier:) –
Nauplius
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>
© 2022 - 2024 — McMap. All rights reserved.