0

This is bugging me because it only moves right to left slightly and everything is offset to the right because the width is flowing over.

I have set to my navbar properties:

.navbar{
    background: rgb(7, 102, 197);
    background: linear-gradient(0deg, rgba(7,101,195,1) 0%, rgba(0,72,144,1) 100%);
    padding:0;
    width: 100%;
}

within index.css i also have width 100%

Taking up these too many pixels (the below graphic should fit perfectly)

From the second image you can see it is greater

enter image description here

I did try applying:

overflow-x:hidden;

But this doesn't remove the issue

3
  • is this issue only in navbar ? or the whole body is affected ? Commented Feb 7, 2022 at 5:49
  • The issue is not with the navbar. Some other element is overflowing out of body Commented Feb 7, 2022 at 5:56
  • That's what make the distance between navbar to the absolute right. somewhere in the other div there are some elements that has fixed width defined in px . that's making things wider and push out of the max-width. Commented Feb 7, 2022 at 6:07

1 Answer 1

1

Have you set the width to 'device-width' in the HTML?

Because this 100% width is subjective to our device- your code works fine with the following tag added in HTML:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.