Ask coding questions

← Back to all posts
My code doesn’t quite seem to work
Moth7 (0)

So my goal is to recreate the google homepage (im taking a course on html) So everything is going fine until I get to the CSS. Things like the font-family or color elements just don’t work at all. Ive compared it with my sources and they look fine but obviously something is wrong. Maybe i’m missing something, hope you guys can help!

https://Google-Homepage2.moth7.repl.co

Voters
Moth7 (0)
Comments
hotnewtop
ch1ck3n (2065)

Also why do you have two html tags delete the second one

ch1ck3n (2065)

let me guess: cs50?

notGilbert (121)

You need to include the <style> inside the <head> or the <body>

anything inside the <html> won't be rendered / computed, that's why your style isn't being applied

<!DOCTYPE html>
<html>
  <head>
    <title>example</title>
    <style>
      p {
        color: red;
      }
    </style>
  </head>
  <body>
    <p>red text</p>
  </body>
</html>