Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS SVG text-shadow is on top of text

Tags:

html

css

svg

I am simply trying to put a shadow behind some text, but the shadow seems to be displayed on top of the text instead. I'm using Google Chrome. This is an image:

image of shadow inside text

Here it is, rendered in your browser:

#title {
  fill: white;
  color: white;
  display: block;
  margin: auto;
  text-shadow: 10px 10px 3px black;
  font-size: 400%;
  text-align: center;
  font-family: consolas;
  font-weight: bold;
  stroke: #F08000;
  stroke-width: 1px;
}
<svg style="background:rgba(0, 255, 255, 0.2); width:100%; height:calc(20vh + 20px); margin:auto; display:block;">
   <text id="title" text-anchor="middle" x="50%" y="20vh">Software</text>
</svg>
like image 892
Daniel Williams Avatar asked Jul 14 '16 00:07

Daniel Williams


People also ask

How do I get rid of text-shadow in CSS?

If you just want to remove text shadows for a single page, just add the CSS snippet to the page CSS instead. If you want to remove text shadows in a single slider module, just open the module settings in the Divi Builder and go to Advanced > Custom CSS and just add text-shadow:none !

How do you put a shadow under text?

Select the text or WordArt that you want to format. On the Format tab, under Text Styles, click Effects, point to Shadow, and then click the shadow style that you want.

How do you put shadow on text in CSS?

CSS Syntaxtext-shadow: h-shadow v-shadow blur-radius color|none|initial|inherit; Note: To add more than one shadow to the text, add a comma-separated list of shadows.

Which property is used to set shadow over the text?

The text-shadow CSS property adds shadows to text. It accepts a comma-separated list of shadows to be applied to the text and any of its decorations .


1 Answers

Decrease horizontal and vertical shadows and increase blur radius in text-shadow property:

text-shadow: 6px 6px 10px black;

Here's the working sample: Check Me!

I hope this is what you are looking for.

like image 165
Hussain Rauf Avatar answered Sep 27 '22 20:09

Hussain Rauf