I've tried to set up a custom font for my website, but it doesn't work neither on Firefox, Chrome or Edge/IE. The network section inside Firefox's developer tools says that the fonts were not found and lists 404s, although the urls should be correct. This is my code:
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/RalewayRegular.ttf') format('truetype'),
url('/wp-content/uploads/font-organizer/ralewayregular-webfont.woff') format('woff'),
url('/wp-content/uploads/font-organizer/ralewayregular-webfont.woff2') format('woff2');
font-weight: normal;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-Light.ttf') format('truetype');
font-weight: 300;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-LightItalic.ttf') format('truetype');
font-weight: 300;
font-style: italic;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-Italic.ttf') format('truetype');
font-style: italic;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-SemiBold.ttf') format('truetype');
font-weight: 600;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-SemiBoldItalic.ttf') format('truetype');
font-weight: 600;
font-style: italic;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-Bold.ttf') format('truetype');
font-weight: 700;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-BoldItalic.ttf') format('truetype');
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-ExtraBold.ttf') format('truetype');
font-weight: 800;
}
@font-face {
font-family: 'Raleway55';
src: url('/wp-content/uploads/font-organizer/Raleway-ExtraBoldItalic.ttf') format('truetype');
font-weight: 800;
font-style: italic;
}
body { font-family: 'Raleway55'!important; font-weight:normal!important; }
h1 { font-family: 'Raleway55'!important; font-weight:normal!important; }
h2 { font-family: 'Raleway55'!important; font-weight:normal!important; }
h3 { font-family: 'Raleway55'!important; font-weight:normal!important; }
h4 { font-family: 'Raleway55'!important; font-weight:normal!important; }
h5 { font-family: 'Raleway55'!important; font-weight:normal!important; }
h6 { font-family: 'Raleway55'!important; font-weight:normal!important; }
p { font-family: 'Raleway55'!important; font-weight:normal!important; }
q { font-family: 'Raleway55'!important; font-weight:normal!important; }
li { font-family: 'Raleway55'!important; font-weight:normal!important; }
a { font-family: 'Raleway55'!important; font-weight:normal!important; } <code>
Can you help? Thanks!
/
from/wp-content/
. – user4616966*{font-family: 'Raleway55';}
. Don't set it to important or it will be harder to change later on. – user4616966../
in front of a url to represent the parent folder. Let's saywp-content/stylesheets
and your fonts arewp-content/fonts
then you'd type in../fonts/myfont.fontExtension
. – user4616966