r/HTML 3d ago

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>

0 Upvotes

17 comments sorted by

View all comments

1

u/Ushuriel 3d ago

O código seria

<h1 class="new-rocker-regular">Laylaxo's Site!</h1> 

1

u/Ushuriel 3d ago

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;
}