skip to Main Content

Please help me in figuring out this problem. For the attached html and css I am getting that extra margin on the right side which I dont need. What changes should I make. Please tell me your suggestions. I am new to web development. Thank you.

What I have already tried is to change the position of hero from relative to fixed and it/remove the extra margin, but that makes my header to cover all the page and the rest content wont show.

Following is my code. 3rd image that is ‘browser output screenshot’ shows that I get unwanted margin or whitespace on the right hand of my page. Scrollbar also becomes scrollable because of this margin. I have marked the margin with a vertical red line. How can I edit my css to remove that margin and make my page unscrollable. Thank you.

html screenshot

css screenshot

browser output screenshot

2

Answers


  1. Wish I could comment, but please provide the entire code in your question, instead of providing screenshots, for us, to reproduce and answer properly.

    Login or Signup to reply.
  2. You need to change the width of .hero from 100% to 100vw

    & trying not to use position:relative in this case

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search