I have a an html element in the DOM;
<h5 class="white-shadow"> Basic </h5>
It has the following css rule attached;
.white-shadow{
text-shadow: -1px 0px 5px #ffffff;
}
The h5 is within a list element that has a gray background. The idea is to add the white text shadow for better readability. The odd thing is that I see no results.
This is what I see in the browser;
This is what devtools shows me;
But if I change the background color from white to red I am able to see the change.
This is what I see in the browser;
This is what devtools shows me;
I haven't touched the alpha parameter of the text shadow rule. For some reason the red text shadow color is visible while the white text color is not.
I am using bootstrap3, although I don't expect that it is blocking white text shadows anywhere.
Why can't I see the white shadow around the text? How could I fix it?
Shadow is there in the DOM but because of your background-color, it is not much noticeable
see here
My suggestion, either change shadow color or background-color
here is what you want
use
.white-shadow{
text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff, 1px 1px #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}
text-shadow value quoted from thread : Text border using css (border around text)
Related
In my application I have a custom icon with black fill and now my requirement is to change the fill color to white and and border of the smiley will be black. And the smiley icon is given below
and my code is
<div>
<i class="icon icon-smiley-face-2"></i>
</div>
Now I want the above smiley face as white filling background and border of the smiley would ne black.
Can anyone help me regarding the same
See if this works or add a custom class on the i tag. If it is not working add an !important like below (only if it doesn't work without it)
.icon-smiley-face-2{
stroke: #000000 !important;
fill: #ffffff !important;
}
You can do that by simple CSS
.icon-smiley-face-2{
color: #fff;
border:1px solid #000;
}
Check if it works. since it's your custom icon not sure how it's interact.
.icon-smiley-face-2{
text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
color: white;
}
Reference - stack ref for answer
I'm having a bit of difficulty with CSS at the moment. I'm trying to apply both text stroke and a shadow, however I'd like to be able to change the opacity of both the stroke and shadow. I've tried however either the text shadow applies and the stroke doesn't or the stroke applies and the shadow doesn't. Any pointers? I can provide the code I was trying to use if need be.
Thanks a lot.
You can use pseudo :after to create strike through effect and play with its opacity to achive what you want.
Check this JS Fiddle I have created. You can change the values in the CSS part to achive what you want: http://jsfiddle.net/_vijaydev/xvse9p1o/
There is other way to make your text strike using text-decoration:line-through and apply that at your css.
DEMO
I found that this works for IE:
text-shadow:
2px 2px 10px color,
0px 2px 10px color,
2px 0px 10px color,
2px -2px 10px color,
0px -2px 10px color,
-2px 0px 10px color,
-2px 2px 10px color,
-2px -2px 10px color;
and '-webkit-text-stroke:2px color;' & a 'text-shadow:' rule for FF/Chrome.
Obviously you can change the px to what you want.
Is it possible to apply two text-shadow values on one p element with CSS3?
I want to create a very light black background with a 1 pixel border.
Something like this:
text-shadow: 0 0 55px black; (very light black background to increase white text readabilitiy)
&
text-shadow: 0 1px 0 rgba(0,0,0, .25); (one pixel black drop shadow)
You can simply seperate the shadows with a comma:
text-shadow: 0 0 55px black, 0 1px 0 rgba(0,0,0, .25);
Demo fiddle
You may want to have a look at this article on MDN for further information.
The text-shadow CSS property adds shadows to text. It accepts a
comma-separated list of shadows to be applied to the text and
text-decorations of the element.
Each shadow is specified as an offset from the text, along with
optional color and blur radius values.
Multiple shadows are applied front-to-back, with the first-specified shadow on top.
You can try using this code :
p { text-shadow: 1px 1px 1px #000, 3px 3px 5px blue; }
REF : CSS SHADOW TRICKS
I needed to show color around the text in my HTML page, I tried border property but it is giving square box around the Text.
How to achieve below requirement
Thanks.
I would write the code here... But this link http://line25.com/articles/using-css-text-shadow-to-create-cool-text-effects explains it so well.
Example Demo : http://codepen.io/anon/pen/CDsFb
This is actually much better ...
text-shadow: 3px 3px 0 #000,
/* Simulated effect for Firefox and Opera and nice enhancement for WebKit */
-3px -3px 0 #000,
3px -3px 0 #000,
-3px 3px 0 #000,
3px 3px 0 #000;
This will ensure it looks like a proper border you want and not a simple glow around your text.
You are looking for text-shadow CSS property
text-shadow: 0px 0px 3px orange;
http://jsfiddle.net/NGPhL/
http://www.quirksmode.org/css/textshadow.html
You may use
text-shadow: 0px 0px 4px #1d1dab;
filter: dropshadow(color=#1d1dab, offx=0, offy=0);
http://css3generator.com/
If browser don't support CSS3:
Use can use two text nodes with 17px and 18px font-size (for example) and positioning by CSS first under second (position:absolute, z-index:100, left, top, etc) with different colors.
Thanks For your suggestions, I found an example to get this requirement here
http://gazpo.com/2011/02/text-shadow/
7. Border Around the text
text-shadow: 0 -4px #00468C,4px 0 #00468C,0 4px #00468C,-4px 0 #00468C,4px -4px #00468C,-4px 4px #00468C,4px 4px #00468C,-4px -4px #00468C;
You can use the CSS3 text-shadow property. As long the browser supports webkit, this should surfice.
main-heading h2{
-webkit-text-stroke: 2px #42a6e1;
}
The text-shadow not working fine. So use text stroke instead of text-shadow. Text shadow also makes difficulties at different devices.
You can see in the screenshot given below
I'm investigating since some days box-shadow and text-shadow. I'm trying to gain the following effect. I want a glow come out from the text of the <a> once hovered. Simple, this should be easy as I explored using text-shadow. Ok, but it works with small glows, I mean, once the glow is bigger you just cannot see the glow due to its high blur. There has to be a solution for this. An image will explain better than 100 words.
This is what I want to gain:
LINK:
HOVER:
This is the code I've used for
#projectBox a:LINK{
background-image: url('../_img/showcase/projectTabs/link.png');
}
#projectBox a:HOVER{
background-image: url('../_img/showcase/projectTabs/link.png');
color:#fa0000;
text-shadow: 0 0 80px white;
}
I know I can use background image again for the hover but I want to avoid this. The problem is that if you add more blur it doesnt appear anymore, as its too blur. the other two properties dont help too much, as I want the glow to begin from the middle.
Lets work out this together and see how we can do with CSS a wide and high glow effect.
You can add multiple text-shadows:
text-shadow:
-3px 0px 10px #FFF,
3px 0px 10px #FFF,
0px 0px 10px #FFF,
-3px -3px 10px #FFF,
3px -3px 10px #FFF,
0px -3px 10px #FFF,
-3px 3px 10px #FFF,
3px 3px 10px #FFF,
0px 3px 10px #FFF;
This would give you a wider, fuller glow, as there are 9 separate shadows surrounding the text. Adjust the values to get the intensity you're looking for.
(the values are a random guess - untested as I'm on my phone) :)
http://jsfiddle.net/pzMmC/ -
You can overlay concentric shadows to multiply the effect:
a:hover {
text-shadow: 0 0 80px white,
0 0 70px white,
0 0 60px white,
0 0 50px white,
0 0 40px white,
0 0 30px white;
}
I've written a test: http://jsfiddle.net/simbirsk/DnHKk/
Why not use CSS3's gradients?
Take a look at this fiddle.
You can generate your own gradients here or here.