Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to apply letter and word spacing to a "font" using css?

I have a custom font with code like this -

@font-face {
font-family: 'classylight';
url : 'some path';
font-weight:normal;
    }

I want to set some values exclusively for this font everywhere on the site like letter spacing, word spacing, and other styles. I wanted to reduce unneccessary process, and looked for attribute=style property.

I tried -

body [style="font-family:classylight"] {
letter-spacing:50px;
word-spacing:-20px; 
}

It's not working. Can anyone help? I would like to use only css for this. If there's no possibility in css, please refer with javascript, jquery.

PS - I'm not looking for answers which adds styles directly to body part like

p {
font-family: classylight;
letter-spacing:50px;
word-spacing:-20px; 
    } 
like image 864
Kraken Avatar asked Jan 29 '26 08:01

Kraken


1 Answers

Unike text color and size, You can't change letter spacing and word spacing using attribute=style property. You should either change them while creating by changing pen width or you should change them in body of css.

like image 150
G G Avatar answered Jan 31 '26 22:01

G G