Okay
  Public Ticket #1121152
How do i make background image fit to scale?
Closed

Comments

  • gordii started the conversation

    Hi,

    How do I make background image fit to scale or cover on each desktop?


  •  295
    Paul replied

    Hi there!

    Please go to "Appearance > Customize > Site Background Styles" and tick the checkbox to make it fit the viewport.

    I hope this helps!

    Regards,
    Paul

  • gordii replied

    Hi Paul,

    Did that. Doesn't help on desktop.

    ??

  •  295
    Paul replied

    By default, the theme uses this CSS for making the background image fit to the viewing viewport:

    .full-screen-bg {
        background-repeat: no-repeat;
        background-position: center center;
        background-attachment: fixed;
        background-size: cover;
    }
    

    and it is automatically controlled by CSS itself for how the image will display.

    In other words, it means that an image can be automatically cropped by CSS to make it fit the viewport because the ratio of an image cannot fit to every viewport size in different devices/environments.

    Anyway, you can try using this custom CSS to adjust the position of your bg image:

    .full-screen-bg {
        background-position: top center;
    }

    You can apply the code by going to "Appearance > Customize > Additional CSS".

    You can also find more information about the CSS properties here: https://www.w3schools.com/cssref/css3_pr_background.asp

  •  1
    jguillenart replied

    Could i put the background just on the content area, not full-screen?

    I mean, full screen covers the whole area, i would like to set it just in the content area, not the menu.

    I got the Finnik theme.

    Thanks.

  •  295
    Paul replied

    Hi jguillenart,

    Yes. You can use custom CSS to add custom background image to the content area. Please try something like this:

    #content-container {
        background: url([path-to-image]);
    }
    

    For more info about the CSS background, please see here: https://www.w3schools.com/cssref/css3_pr_background.asp

    If you would also like to use custom CSS for other elements, I recommend Developer Tools on Chrome or Firebug on Firefox to inspect the elements on the page. Then you will know which CSS selector to adjust.

    More info: https://uxbarn.com/inspecting-elements-developer-tools/

    Regards,
    Paul

  •  1
    jguillenart replied

    Thanks for reply!

    I'm trying right now to customize the content area dimensions for some pages, the index for example and other portfolio items.

    I really appreciate the work and love the Finnik theme but i'm going to need some detailed improvements.

    ¿Are you planning to extend this theme?

    Regards,

    J.Guillén

  •  295
    Paul replied

    Thanks for loving the Finnik theme!

    If you would like to customize the CSS for some pages, you can use the specific CSS class that is in the "body" tag (screenshot: https://cl.ly/lFNd ). Please use the Developer Tools on Chrome to inspect the element. Then you can use it like this:

    .page-id-191 #content-container {
    ...
    }

    The rules you set here will only affect page ID 191.

  •  1
    jguillenart replied

    Wow, that's such a great idea!

    I didn't notice that id's on different pages.

    Thanks man.

    ¡Cheers!

  •  295
    Paul replied

    You're welcome. Glad I could help!