Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1307348

    Hi

    Some containers of my website are at 80% width. I achieved it with the following CSS:

    #section-width {
    max-width: 80%;
    left: 50%;
    position: relative;
    transform: translateX(-50%);
    }

    It works fine as long as the background colour is the same as the container colour.

    I now would like to apply the same to the footer, but there I have the problem that the footer container has a background colour which doesn’t match the website. So you can see 10% white on each side.

    How can I achieve this same effect but with the colour to be even? I know, I had to make it complicated…. I didn’t feel like the default presets of 1/5 3/5 1/5 looked as nice as 80% width.

    #1307487

    Hey june,

    I think it would be better if you changed the width of the container element instead, then apply the background colour the ID you have assigned:

    #section-width .container {
       Your width goes here
    }
    
    #section-width {
       Your background colour goes here
    }

    Best regards,
    Rikard

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.