Support » Theme: Twenty Twelve » Auto resize background

  • jakkuftw

    (@jakkuftw)


    Hey,

    Someone know how to make auto size background image for child theme ? Already had search in google for some tips, but nothing usable…

Viewing 15 replies - 1 through 15 (of 19 total)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Have you tried the background-size property?

    jakkuftw

    (@jakkuftw)

    I don’t find where is css with “body.custom-background {”

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Use a Browser Inspector Tool to easily find which elements have which styling.

    jakkuftw

    (@jakkuftw)

    Yes. I’m using it. But in style.css dont find it:

    body.custom-background {
    background-color: #F2836B;
    background-image: url('http://www.website.com/wptest/wp-content/uploads/2012/11/background.jpg');
    background-repeat: no-repeat;
    background-position: top center;
    background-attachment: fixed;
    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    The browser inspector tool should be enough to see the CSS styles applying to the element. You should then override or add-to these styles in your Child Theme style.css (create new code). You shouldn’t modify current code in your parent theme’s files.

    jakkuftw

    (@jakkuftw)

    Yes I know it. But anyway background don’t auto fit with browser size.. I need to see background nice with aspect ratio in any resolution. Default img aspect ratio 16:9, in 4:3 resolution img can be centered, but hidden left and right sides..

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Perhaps this tutorial will help.

    jakkuftw

    (@jakkuftw)

    I don’t know how it is possible, but I cant find from where it’s generated:

    http://img831.imageshack.us/img831/3225/cssi.jpg

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    It’s probably generated by a plugin, but why are you concerned with this?

    jakkuftw

    (@jakkuftw)

    Because I don’t know where to put code from your link to tutorial.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    You should add it to your Child Theme style.css file (stylesheet).

    jakkuftw

    (@jakkuftw)

    Everything was fine but, need to insert

    <div style="max-width:500px;">
        <img src="..." />
    </div>

    Where put this code ?

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    I think that code is the equivalent of the code you added in style.css. You need not add it.

    jakkuftw

    (@jakkuftw)

    I don’t know but it doesnt work for me.. :/ Too noob to make it.

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    What code have you added into style.css, from the tutorial?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Auto resize background’ is closed to new replies.