简体   繁体   中英

Unwanted white space on right of website html/css

So I have tried to get rid of this white space to the right of my website for ages now. I've tried all the overflow-x: hidden rules but none of them seem to work.

I have ruled it down to when I remove:

(div id="content5" style="position:absolute;")
(img style="width:175px; height:175px;" src="Images/Graphic.jpg")
(/div)

from the html file then the white space goes away. How do I put the picture on my web page without getting the white space? Don't worry I am using angle brackets for my html.

You can view my website here .

CSS:

view code here

HTML:

view code here

Make the width of the #content5 element set to the pixel width of the image:

#content5 {
  width:175px;
}

Right now, the width is set to 50%. But that essentially sets it to 50% of the width of the parent element, which is the whole page. If you look in the inspector, the divs containing all of your images are much larger than they need to be because of this.

EDIT: Included inspector image of Chrome session OPs问题的证据

@Daniel Ravens if you insert the following code it should fix your problem:

html { 
  background: url(Images/FrontCover.png) no-repeat center center fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

This code basically stretches everything on the page to make it fit I got this code from the following site: CSS Tricks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM