Trying to find the answer quite long, but I am not even sure how to express the question to searchbar - so I'll try to explain here and if you know that it was already answered I will be happy for the link :)
I am creating a wordpress theme using The Underscores framework. I want make my header to be dependent on the background image height. I mean - I can upload there an image of any size and header's width will be 100 % of image and height wll be dynamically change according the screen size.
Better for imagination, here's an example: http://hitchdiary.cz/
Try to change size of the window - image is allways fully displayed and the height of the header changes.
So that's what I want. What I have is a static size header and background image is adjusting according the screen size.
.site-header {
height: 100%;
width: auto;
background-color: #000;
background-size: 100%;
}
Header image is set by user in wordpress adjust section. In code it is this way:
<?php if ( get_header_image() ){ ?>
<header id="masthead" class="site-header" style="background-image: url(<?php header_image(); ?>)" role="banner">
<?php } else { ?>
<header id="masthead" class="site-header" role="banner">
<?php } ?>
Thanks for any advice. Sorry if that's obvious. I'm quite a newbie.
WHAT'S GOING NOW: