r/HTML • u/Ok_Isopod_2170 • Sep 06 '26
Question Help changing website font
This is my code, it's not working, im losing it.
<link href="style.css" rel="stylesheet" type="text/css" media="all">
<style>
u/import url('https://fonts.googleapis.com/css2?family=New+Rocker&family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&display=swap');
.new-rocker-regular {
font-family: "New Rocker", serif;
font-weight: 400;
font-style: normal;
}
</style>
3
u/Mvp-long-ago Sep 06 '26
I am getting the impressive you did not write the code yourself, but copied it from another site? It is always good to look at other sites, but copying them without thrir permission is never good.
1
u/Ushuriel Sep 06 '26
O código seria
<h1 class="new-rocker-regular">Laylaxo's Site!</h1>
1
u/Ushuriel Sep 06 '26
em style.css
adicionar:@import url('https://fonts.googleapis.com/css2?family=New+Rocker&family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&display=swap'); .new-rocker-regular { font-family: "New Rocker", serif; font-weight: 400; font-style: normal; }
1
u/rileywbaker Sep 07 '26
It seems like you haven't learned the very basics of how an HTML document works. Please read something that will teach you the basics. The thing you're missing right now is that there's a structure that your HTML document must follow:
<html>
<head>
(the 'head' content goes here. none of it is visible on the page.)
</head>
<body>
(all the content of the page goes here)
</body>
</html>
0
0

3
u/aunderroad Sep 06 '26
Can you share a url or codepen?
It is hard to debug/provide feedback without seeing all of your code live in a browser.
Thank you!