I made the dumb mistake of accidentally erasing all the code when I went to go put a background image. The background image works, but the problem is that having erased the text color code, the text is stuck as black and is unreadable. I looked on multiple sites and posts trying to find something that works but it comes back as invalid. Can someone help me get the text color I want (white) while keeping my background image?
How do i change text color?
@font-face {
font-family: 'Rubik Vinyl';
src: url('https://fonts.cdnfonts.com/s/93371/RubikVinyl-Regular.woff') format('woff');
}
@font-face {
font-family: 'Cabin Sketch';
src: url('https://fonts.cdnfonts.com/s/15530/CabinSketch-Regular.woff') format('woff');
}
@font-face {
font-family: 'DM Sans';
src: url('https://fonts.cdnfonts.com/s/29932/DMSans-Regular.woff') format('woff');
}
/*HEADING FORMATTING */
h1 {
font-family: 'Rubik Vinyl';
color: #1e1c1f;
font-size: 5em;
text-align: center;
}
h2 {
font-family: 'Cabin Sketch';
text-align: center;
color: #1e1c1f;
font-size: 3em;
}
/*REGULAR TEXT FORMATTING */
p {
font-family: 'DM Sans';
text-align: center;
color: #1e1c1f;
font-size: 1em;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Hello</h1>
<h2>Hellooooo</h2>
<p>Nice its working</p>
</body>
</html>
The problem with your code is that your urls to the fonts are not correct. I made this example page with the three fonts you wanted. I used the fonts from cdnfonts.com to make the implementation easier. Also you should spell the font names exactly like they were declared, it matters if theres an '_' or an '-'
In general on Neocities, it's best not to hotlink another Neocities page's images, fonts... any asset file, really.
This is frowned upon as it uses their bandwidth and it means you lose everything if their site goes down or the files get moved around. Hotlinking to Neocities files from outside NC doesn't even work.
Best practice is to download free-to-use fonts (from DaFont or something) and keep them in your own /fonts folder on Neocities.
Good luck!
Hello, I'm working on a website on Neocities and I want the background colour on my index, How do I add it?
Hello! I'm working on two neocities sites at the same time (one for general use, one more specialized). I'm trying to keep the two codes similar in style, and am heavily referencing W3Schools' tutorials. I am only able to change the background and text colors for one site. The only difference is the colors themselves, though I'm using hex code for all colors; I've copypasted the nonfunctional code below. I'm so glad to have found this community!
body {background-color: #000000
color: #ffffff;
}
a:link {
color: #ae2f2f;
}
a:visited {
color: #c4b2b2;
}
a:hover {
color: #ffffff;
}
a:active {
color: #aeaeae;
}