• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Extending header image in MOBILE to edges of screen?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Extending header image in MOBILE to edges of screen?

This topic is: not resolved

Tagged: background

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 7 months ago by keithmoore43.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 27, 2016 at 12:37 am #190277
    keithmoore43
    Member

    Been working on my problem with the header in my Genesis Sample theme.

    I've got the image extending the length of the screen on my desktop, but my ongoing problem has been this header image getting cut in half when I view it on my iPhone 6. However I created a smaller version of the header in Photoshop and it now shows up completely on my iPhone, but doesn't extend to the edges, along with adding some ugly padding beneath it.

    Here is the code I used to get this image sort of working on my iphone:


    @media
    screen and (max-width: 800px) and (min-width: 320px)
    {
    .header-image .site-title > a{
    background: url('http://keith-moore.net/wp-content/uploads/2016/07/iphone-header.jpg') no-repeat;
    width: auto;
    }
    }

    I've also played with width:100% to no avail. Any ideas I could try?

    Many thanks...

    http://www.keith-moore.net
    July 27, 2016 at 6:13 am #190287
    Victor Font
    Moderator

    background-size: cover; will scale the background image to be as large as possible so that the background area is completely covered by the image

    background-size: contain; will scale the image to the largest size such that both its width and its height can fit inside the content area


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 28, 2016 at 12:07 am #190355
    keithmoore43
    Member

    I appreciate the response, Victor.

    When I use "background-size: cover;" for this particular @media screen, I get a header that's cut off, and looking a bit oversized and pixalated. When I use "background-size: contain" I get the original header image fitting within my iPhone screen, but it doesn't extend to the edges of the screen like the desktop version does.

    Also, both options reveal the original green border underneath the header image--and when it's set to "contain" I get a larger green padding area underneath the image even if I set the padding to zero.

    So...do I need to set my background AREA differently in mobile so the image knows where to fit?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble