What is wrong with this code>


#1
Welcome to Hamilton & Stanley!>https://scratch.mit.edu/projects/148475409/

#2

Your link didn’t work for me :frowning:


#3

'''<html><webpage><head><style><body>Welcome to Hamilton & Stanley!<background-color=#244343>></style></head></body><video <embed/>https:// scratch.mit.edu/projects/148475409/<embed/><video></embed></webpage></html>'''


#4

Reformatted for myself:

<html>
<webpage>
<head>
<style>
<body>Welcome to Hamilton & Stanley!
<background-color=#244343>>
</style>
</head>
</body>
<video <embed/>https:// scratch.mit.edu/projects/148475409/<embed/><video></embed></webpage></html>

To start with, I’ll give you the boilerplate HTML code. (click and it will expand)

Code
<html>
<head>
<style> <!-- if you choose to do it here instead of a css doc-->
</style>
</head>
<body>
</body>
</html>

The first thing I noticed was that you used some strange tags, and you overlapped tags that aren’t meant to be overlapped.
<webpage> is not a tag, nor is <background-color>.
Your <head></head> tags need to go before your <body> tags, otherwise it won’t format right. <video> and <embed> are two different tags. For scratch, I’m assuming you meant to use embed.

As far as the background color goes, you would go back to your <style> tags, and between style and /style, you would do something along the lines of

body{
   background-color: #244343;
}
Your fixed code
<html> 
<head>
<style>
body{
background-color: #244343;
}
</style>
</head>
<body>
<h1> Welcome to Hamilton & Stanley! </h1>
<embed src="https://scratch.mit.edu/projects/148475409/" width:"inherit" height:"inherit">
</body>
</html>

#5

My website is still not blue.


#6

Could you please copy and paste your fixed code?


#7
<head>
<style>
body{
background-color: #244343;
}
</style>
</head>
<body>
<h1> Welcome to Hamilton & Stanley! </h1>
<embed src="https://scratch.mit.edu/projects/148475409/" width:"inherit" height:"inherit">
</body>
</html>```

#8

To correctly format your code, you use three backticks ( ` ) not three apostrophes ( ’ ).

If you still can’t get it right, I’d suggest using something like pastebin.


#9

It looks like more of a dark dark blue color to me, is this what’s showing for you? (Not talking about the code on the side)

If not, what are you using to view the code?


#10

I copy and paste it to a website.


#11

What website?

You’re probably doing it wrong.

Instead of doing that, try doing this:

  1. Open up a text editor on your computer
  2. Paste your code into it
  3. Go to "Save As" and save it as "index.html"
  4. Double click on the new document named "index.html" and it should open up the document on a web browser, where it will show you the webpage.

#12

I got it to work now.


#13

Great! Later on when you make static websites for fun and whatnot, I’d recommend codepen.io.


#14

Okay. I’ll do just that.


#15

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.