-1

I'm working on a project for fun and have finally completed it. Well, I thought I did. This is for an email ad so the width of everything has to be 640px and all through all the components are. I have so much white space on the right side and I don't know how to get rid of it. Does anyone know how?

This is the header space which is the same with all the sections below it

THE PICTURE IS 640px and it seems the page is 2x the size

  • You could try adding `style="max-width: 100%; max-height: 100%;"` in the `` tag. – Ahijit Jun 08 '20 at 18:51
  • 3
    Can you please provide your HTML and CSS, without seeing it, we cannot help you. – user2321959 Jun 08 '20 at 18:52
  • Does this answer your question? [Make fill entire screen?](https://stackoverflow.com/questions/5721904/make-body-fill-entire-screen) – Vepth Jun 08 '20 at 18:57
  • 1
    The "page is 2x the size" because that is the width of your browser window. You can "get rid of it" by making the window narrower. I also see that you have a `width` declaration on your `html` element. `html` is the root element and not the viewport. – charles Jun 08 '20 at 19:02

3 Answers3

2

One minor thing: you shouldn't try to set the width of the <html> tag: it will always be at least as wide as your browser window (or your HTML email client's viewport).

It looks to me like you have succeeded in limiting the width of all your content to 640px, which is what matters. You can safely ignore that orange-highlighted space you're seeing in the inspector: that's the space that's left between the right edge of your 640px-wide webpage and the right edge of your browser viewport.

The blue-highlighted area is showing that you're inspecting the <html> element, and there isn't anything outside of that element.

simmer
  • 2,508
  • 1
  • 17
  • 21
-1

your problem is using width: 640px; you should Use: Width: 100%;

SoliMoli
  • 732
  • 2
  • 5
  • 24
-1
html, body {
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
overflow-x: hidden;
}

This works like magic, not only for this issue but also any white spaces on your website.

Happy Coding.

code0789
  • 41
  • 2
  • 9