Background-color without following max-width

Asked

Viewed 52 times

2

I have stipulated a margin of at most 1500px, max-width: 1500px, for my site, but the behavior of the background-color follows up to this margin, is not wrong, quite the contrary, however I wanted to leave the color of my div width at 100% but the rest of the elements following this margin.

Could I accomplish this or not? I can’t think of any other idea...

I think there would be no way. I was wondering, if I have to hit the margins in the hand using media-queries?

  • Do you have an example to show us?

  • puts that div inside another day with width:100%

  • Could for a simplified example of the problem to understand?

  • Thanks for the personal suggestions. I paused and went to review line by line my css and html and found the error.

  • That’s why it’s always important to post code, read Help http://answall.com/help/mcve, if you ask questions like that, it will generate random answers that won’t serve you or any future visitor ;)

  • I was still having some doubts, I had solved it by the way. Whoever has this doubt, just follow what Andrepaulo said. worked perfectly.

Show 1 more comment

1 answer

3


You can add the background color directly into the body. Follow the example:

<style>
body {
    background-color: yellow;
}
</style>
  • It might work, but I only have this div that has this blue color and makes a reference at the top of the page, the container and the rest of the country is white. I’m doing a SPA, so..

  • I understand. In this case it would be necessary a more concrete example to try to understand better and to be able to do tests.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.