Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

[HTML] Basic HTML / CSS question

I am creating my first website for a course I am taking and for some reason cannot get background-color to work.
I only am on my first 15 lines or so of code so i may be missing something

here is my css code

Code
<!DOCTYPE html>
<html>
<head>
<style>
body {
    background-color: green}
h1 {
  color: gold;
  text-align: center;
}
h2 {
  color: gold;
  text-align: center;
}
</style>
</head>
</html>

all of the other colors are working besides my background coloring
[Image: giphy.gif]

Is this all of the code for your website? I can’t see anything wrong besides that fact you don’t have a body tag. If you are using external CSS libraries try adding ‘!important’ after the green.
You need a semi-colon after green.
Always remember to end your tags but also get use to separating your files correctly. You may not feel that's it's 'necessary' since you're just learning but these are the style of habits you want to pick up early.
[Image: rXKOqlS.gif]
If you're defining the color in body over html, you'll need the actual <body> tags in the html below before you can see it :)
(Aug 5, 2018 12:45 PM)petercraig Wrote:  If you're defining the color in body over html, you'll need the actual <body> tags in the html below before you can see it :)
Stop bumping old threads you retard. They were obviously solved.
Je t'aime
[Image: fpZ5a5g.png]
(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by x_TerminalOct 5, 2017 02:30 PM 11 224 Oct 5, 2017 02:30 PM
Last Post: Nachfolger
[Help] by TʏʟᴇʀNov 15, 2016 07:17 PM 3 147 Nov 15, 2016 07:17 PM
Last Post: Tʏʟᴇʀ
[Tutorial] by VelozitySep 21, 2014 02:13 AM 0 66 Sep 21, 2014 02:13 AM
Last Post: Velozity