• Resolved danseth

    (@danseth)


    I am trying to add a single background image to all my pages. I have reduced the width of the footer and header. At the moment the same image is displayed separately for the header section, main wrapper and footer sections.

    page url: here

    Is there a way to do this in CSS?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter danseth

    (@danseth)

    This is the code I have used to resize and add the background image:


    /* sets the background image */
    body {
    background: url(/wp-content/uploads/2016/01/daisy-background.jpg);
    }

    /* sets width of header and footer */
    @media (min-width: 1200px) {
    .container, .navbar-fixed-bottom .container, .navbar-fixed-top .container, .navbar-static-top .container, footer#footer, .sticky-disabled .tc-header, .sticky-enabled .tc-header {
    width: 1170px !important;
    }

    .sticky-disabled .tc-header, .sticky-enabled .tc-header {
    left: 50%;
    transform: translate(-50%, 0);
    }

    footer#footer {
    margin: 0 auto !important;
    }
    }
    .row-fluid .navbar-wrapper {
    float: none;
    margin: 0 auto;
    width: 1170px;
    }

    /* sets colour of main rapper to white and removes any gaps */
    #main-wrapper {
    background: white;
    padding-top: 20px;
    margin-top: 0px;
    margin-bottom: 0px;
    }

    /* sets the background image */
    body {
    background: url(/wp-content/uploads/2016/01/daisy-background.jpg) no-repeat center center fixed;
    background-size: cover;
    }
    /* sets colour of main wrapper to white and removes any gaps */
    #main-wrapper {
    	padding-top: 	20px;
    	margin-top:     0px;
    	margin-bottom:  0px;
    	background: white;
    }

    You need to adjust margins/padding against the white background.

    Thread Starter danseth

    (@danseth)

    That is brilliant, thank you ever so much, had been pulling my hair out looking for that, haven’t come across the ‘background-size’ command before. Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Single background image with reduced width header and footer’ is closed to new replies.