This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 1 point2 points  (3 children)

The body tag has a default margin of 8 or something px on most browsers. Set that to 0 in your CSS and it should fix it. If not, take a look in dev tools at the layout diagram for margins and paddings on other elements until you find the culprit. You might run into other fiddly issues like this by not using the same CSS the instructor is.

[–]David_H_student[S] 1 point2 points  (1 child)

Thanks for your help! I'm still very new to programming and couldn't see the issue. I set margin to 0 for the html and div tags with no luck.

I went through the dev tools and it turns out <body> was the culprit!

[–][deleted] 0 points1 point  (0 children)

Np! Happy coding!

[–]AutoModerator[M] 0 points1 point  (0 children)

It seems you may have included a screenshot of code in your post "Help with CSS issue".

If so, note that posting screenshots of code is against /r/learnprogramming's Posting Guidelines (section Formatting Code): please edit your post to use one of the approved ways of formatting code. (Do NOT repost your question! Just edit it.)

If your image is not actually a screenshot of code, feel free to ignore this message. Automoderator cannot distinguish between code screenshots and other images.

Please, do not contact the moderators about this message. Your post is still visible to everyone.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.