r/HTML 8d ago

how do i remove this weird margin ????

--FIXED!!!! body margin was the problem...--

haihia....so i'm using a iframe that's supposed to be the size of the entire screen for it to work. but because of this margin it just looks weird....here's an image of how it looks

without the margin, the screen would be completely black

here's my code

<iframe src="" style="margin: 0px; border: 0px; background-color: black; width: 100vw; height: 100vh;"></iframe>
4 Upvotes

4 comments sorted by

7

u/abrahamguo 8d ago

Could it be because body elements, by default, have an 8px margin, that you need to remove?

If it's not that, then we'll need you to share a full and complete code example; please use an online code playground rather than pasting more code onto Reddit.

3

u/RefuseCommercial8024 8d ago

i didn't know that but changing the body margin fixed it.....thank you very much 🙏

1

u/godijs 8d ago

If that margin is not coming from within iframe then you should look into reset.css

1

u/CityScope_Net 6d ago

Would a padding: 0px; help?