Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color around the Text in HTML

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

enter image description here

Thanks.

like image 507
Theja Avatar asked Jan 18 '13 14:01

Theja


3 Answers

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.

like image 182
Debajyoti Das Avatar answered Oct 20 '22 10:10

Debajyoti Das


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

like image 30
David Diez Avatar answered Oct 20 '22 10:10

David Diez


You may use

text-shadow: 0px 0px 4px #1d1dab;
filter: dropshadow(color=#1d1dab, offx=0, offy=0);

http://css3generator.com/

like image 30
Veikko Karsikko Avatar answered Oct 20 '22 11:10

Veikko Karsikko