r/HTML • u/TrainF1re • Sep 14 '26
Question Help with making a HTML/CSS web page?
Hey all--I've got my first coding assignment and have hit a brick wall. Our teacher has given us random basics, like adding a button, adding paragraphs and headers, but now he's thrown us at the wall and told us to make a website, but he hasn't actually taught us how to add all these things together? Everything we've done, he's given us copy-and-pasted stuff we *tweak,* but not actually code ourselves.
Any knowledge or help would be greatly appreciated, as I want to learn and do well in this class. (Our teacher is currently stuck in South Korea and is not being allowed to leave, so we can't exactly get more assistance from him, at the moment.) DMs open, as well as here. I have a layout design and know what I want to do, I'm just struggling to apply it, I suppose.
A current error I also have and cannot figure out why, is:
failed to tokenize "</html>\n", expected attribute, ">" or "/>". (parser-error)
<!DOCTYPE html>
<html lang="en">
<head>
<h1> NF - FEAR </h1>
<h5> Released November, 2025 </h5>
<meta charset="UTF-8" />
<title>Title</title>
<link rel="stylesheet" href="styles.css" />
<script src="script.js"></script>
<div style="background-image: url(NF%2520Fear%2520image%2520ideas/Websitebackground.png);"/>
<meta charset="UTF-8" />
<title>Title</title>
<link rel="stylesheet" href="styles.css" />
<script src="script.js"></script>
</head>
<body>
<p> How to get rid of white background for text????</p>
<button type="button">NF - FEAR</button>
<a href="https://youtu.be/lLFoLJIXayk?si=A2H-MySXY_dCKj02"> NF - FEAR</a>
</body>
<div> <img src="img/Websitebackground.png" alt=""></div> <!-- Alt thing not needed? -->
<div background-image: url(Nf_website_concept);
</html>
3
u/AqueM Sep 14 '26
Two things: div's don't go outside the
bodytag, so your last couple div's are invalid, and thebackground-imagein the last one should go intostyle=""like you did earlier, and you also have that tag opened (all tags should be formatted like<div>some content</div>) see if this helps your html parse. (edits coz autocorrect fkd me over)2
u/sheriffderek Sep 14 '26 edited Sep 14 '26
Join the CSS Discord so you can ask questions and share screenshots and stuff. This wall of white and unformatted code - and no clear goal - is going to be the slowest.
The problem is that your teacher isn’t teaching you how to think about content and how to think about HTML as data structure. First you need to have a clear goal second, you need to understand how the data should be structured regardless of HTML just in general standard hierarchy stuff. Then you need to think of the HTML elements  has just a bunch of choices which element is the right element to describe that piece of content. Then you need to think about what pieces of content might be nested in other pieces of content. And a good way to get used to this early is to learn about screen readers and how they parse content and read out what’s on the screen. Give that a shot.
1
u/davorg Sep 14 '26 edited Sep 14 '26
Some HTML tags can only be used inside
<head>. Most HTML tags can only be used inside<body>. Very few can be used inside both. Most of your problems are caused by the fact that you have put<body>tags in your<head>section (and<head>tags in your<body>section).Of the tags that you use, only
<title>,<link>and<meta>should be in the<head>section. Everything else should be in the<body>section.This is slightly confused by the fact that if an HTML parser is processing a
<head>section and comes across a tag that should be in<body>, then it assumes the<head>is finished and starts processing an imaginary<body>.Once you sort out the tags into the correct section, things should get a lot better.
Your structure should be something like this:
Two other hints...
<head>or the<body>(you had two<div>s that are outside of both)<meta ... />) are no longer needed. It's simply<meta ...>. If you've been taught that, then I worry slightly about the quality of the materials you're learning from3
u/HighUnderground Sep 14 '26
Not certain whats causing that error directly, seems like an open tag that isnt closed perhaps or aftermath from one of the other issues i see?
there's a few obvious issues here I do see:
You have multiple things inside of your HEAD tags that should be in the body:
<h1> NF - FEAR </h1>
<h5> Released November, 2025 </h5>
<title>Title</title> (this is technically the correct place but you have it twice)
<div style="background-image: url(NF%2520Fear%2520image%2520ideas/Websitebackground.png);"/>
These two things should be before the close of the BODY tag, not after
<div> <img src="img/Websitebackground.png" alt=""></div> <!-- Alt thing not needed? -->
<div background-image: url(Nf\\\\\\_website\\\\\\_concept);
Also to address the above comment in your code, you do need ALT tags on all images, for compatibility and accessibility
1
u/RealNamek Sep 14 '26
This gen man. Every time they're given something to do, they always bitch about how they didn't have their hands held the whole way. Why is that?
1
u/armahillo Expert Sep 14 '26
Put your sample code in codepen.io or jsfiddle.net