• shelleyann

    (@shelleyann)


    I added a background image and then the text is running into the edge. So I added padding to the main wrapper. Now the Slider is indented by the same amount I added padding.
    body {
    /* Adjust the Image location ‘wp-content/uploads/2014/03/back.png’ */

    background: url(/wp-content/uploads/2014/03/back.png) repeat 0 0 ;
    }

    /* Set the color (#FAFAFA) of the internal body */

    #main-wrapper {
    background-color: #FAFAFA;
    margin-top: 0px ;
    margin-bottom: 0px;
    }

    header.tc-header {
    /* Adjust the Image location ‘wp-content/uploads/back.png’ */
    background: url(/wp-content/uploads/2014/03/back.png) repeat 0 0;
    }

    footer#footer .colophon {
    /* Adjust the Image location ‘wp-content/uploads/back.png’ */
    background: url(/wp-content/uploads/2014/03/back.png) repeat 0 0;
    }

    #main-wrapper {padding: 10px 20px 10px 20px;}

    I tried adding this code and tried several other things and can’t get the slider to be the same with as the content.

    #customizr-slider {padding: 0 -20px 0 -20px;}

Viewing 9 replies - 1 through 9 (of 9 total)
  • Link?
    Anyway negative paddings don’t exist.
    In general if you have a container with a padding x, but you want that a child element don’t have to respect this padding, add a margin property to it with value “-x” (margin can be negative)

    Thread Starter shelleyann

    (@shelleyann)

    https://bcbeanies.com/

    I took out the padding for main-wrapper. You can see now that I need padding on the content…but I think I have to do it for all the inside css styles???

    Thanks very much for your help.

    shelleyann, I cannot see the real site since you’re using that coming soon plug-in.
    Anyway I was not saying to remove the padding to the #main-wrapper, since I couldn’t see what was the real problem, I just said that negative padding doesn’t exist (and I was referring to the customizr-slider css line). So, always considering I didn’t see your site, you could try to use this css

    #customizr-slider {margin: 0 -20px 0 -20px;}

    You’re welcome, hope I can help..

    Thread Starter shelleyann

    (@shelleyann)

    Thank you, yes I had already tried that but it moves the whole slider to the left when I try that code. I just disabled the plug in, you should be able to see the page now. https://www.bcbeanies.com
    Thanks again for your help.

    Oh sorry, didn’t know you have the slider outside the #main-wrapper (my fault, I changed it in my child theme and forget the default positioning).
    So you can do this

    #customizr-slider {width: 1210px;}

    Consider that this way you’ll have to set the right width for all @media queries. It will always be the width of the #main-wrapper for +40 px.

    Anyway setting that padding to the main wrapper ruins the responsiveness.
    Probably would be better if you try to assign the right padding to the contents.

    Thread Starter shelleyann

    (@shelleyann)

    Ok so when you say “responsiveness” do you mean that will slow the site down? The only reason I had to add padding was because I added a background image. If I didn’t, I wouldn’t need the padding but for whatever reason if I don’t add padding with the background image, then the content is pushed right up against the background image.

    Thread Starter shelleyann

    (@shelleyann)

    Maybe it would be easier to move the slider into the main-wrapper???

    No I meant the behavior when you watch the site with mobiles. Or simply when you shrink the window.

    Thread Starter shelleyann

    (@shelleyann)

    oh I don’t like that at all. Is there another way to use an image for the background but not have to add padding? Thanks again for your help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘background image made content too close to edge’ is closed to new replies.