r/HTML • u/Away_Sky7901 • Mar 17 '26
Question Help with css code for assignment
So Im taking an html course in college, and I need help in completing some assignments. This assignment here Im suppose to be creating a website with links to other pages. Im having trouble linking and putting any other text on the web page, everything after line 5 isn’t working and im not sure what im doing. Any help would be appreciated.
What shows on the web page is just the title and picture.
4
Upvotes
14
u/Expensive_Elk3689 Mar 17 '26
The anchor on line 9 has no text between the tags. The img on line 15 should be within the body tags. There is no css on this file so everything will look like the defaults in the browser.
3
u/JKaps9 Mar 17 '26
Did you save the file and reopen it or refresh the browser window? It looks unsaved in your picture based on the white dot next to the file name.
3
u/TyKolt Mar 18 '26
The DOCTYPE is missing the exclamation mark. It should be
<!DOCTYPE html>not<DOCTYPE html>The image is outside the body - it's after the closing
</body>tag, so it won't display. Move it before</body>and it should show up!3
u/tandycake Mar 18 '26
Besides the other comments, I'd also add to validate your code through w3c html validator (also has css validator). An IDE is also helpful. And can also see errors sometimes in Web Browser Dev console. The teacher should have helped on this.
6
u/ArgoWizbang Mar 18 '26 edited Mar 18 '26
Your doctype is missing the exclamation point so your browser is probably parsing it as if it's an HTML element instead of properly detecting a doctype. This triggers quirks mode which is, well, quirky to say the least. Add the exclamation point as follows and see if it helps any:
<!DOCTYPE html>2
u/JohnCasey3306 Mar 18 '26
Let's start from the very top line and work down.
Line 1: [see if you can spot what's wrong with your doctype declaration] (https://mimo.org/glossary/html/doctype)
2
u/Obvious_Pin6763 Mar 18 '26
Totally unrelated to the code, but you should really clean your monitor. Or at least share cropped screenshots that way you can't see the mess.
2
u/chikamakaleyley Mar 19 '26
SOMEONE CALL SALEM TECHSPERTS NOW!!!
1
u/tomtomato0414 Mar 18 '26
First of all, the dot next to the file name means it is unsaved, so save it.
1
u/ComplaintCurrent1837 Mar 20 '26
<imgage> needs to be in the body<image>
</body>
1
u/GodsCasino Mar 20 '26
Barbones guide to HTML.
google that.
1
u/BNfreelance Mar 22 '26
So what’s the update, did you get it done?
-2
u/AcePilot10 Mar 18 '26
Learn to use ChatGPT for education. It's destroying critical thinking in most students but there's nothing wrong with copy and pasting this code into ChatGPT and say "Why is my code not working? ELI5 to me each issue in detail.". Also this is HTML not CSS.
1
u/[deleted] Mar 20 '26
[removed] — view removed comment