How to code a logo image to be responsive in theme
-
I am using the theme Minimum by Qode. I am trying to get the logo image to be responsive. I have read that this theme developer has used javascript to setup the size of the logo for this theme. Below is the code I have tried, two iterations, one to replace the logo image according to the screen size and the second attempt was to adjust the size of one logo image (preferable). If anyone has a solution that would be appreciated. NOTE that there is no header.php file just a responsive.css file. Thank you so much….
—————
First Attempt – Tried to have a different logo image for each screen size: Does Not Work but in one screen size I got a double logo image.@media only screen and (min-width: 960px) and (max-width:1120px)
{.logo a{height: 65px width: 462 !important; background: url ‘logo-image-path’)}}}@media only screen and (min-width: 500px) and (max-width: 960px)
{.logo a{height: 55px width: 391px !important;background: url
(‘logo-image-path’)}}}@media only screen and (min-width: 480px) and (max-width: 767px)
{.logo a{height: 45px width: 320px !important;background: url(‘logo-image-path’)}}}@media only screen and (max-width: 500px){.logo a{height: 33px
width: 235px !important; background: url (‘logo-image-path’)}}}@media only screen and (min-width: 0px) and (max-width: 479px)
{.logo a{height: 30px width: 214px !important; background: url
‘logo-image-path’}}}
———————————————-
Second Attempt – Code used: No double image and the image did not scale to accomodate screen sizes.@media only screen and (min-width: 960px) and (max-width:1120px) {.logo a{height: 65px width: 462 !important; }}
@media only screen and (min-width: 500px) and (max-width: 960px)
{.logo a{height: 55px width: 391px !important;}}@media only screen and (min-width: 480px) and (max-width: 767px) {.logo a{height: 45px width: 320px !important;}}
@media only screen and (max-width: 500px){.logo a{height: 33px
width: 235px !important; }}@media only screen and (min-width: 0px) and (max-width: 479px)
{.logo a{height: 30px width: 214px !important;}}
- The topic ‘How to code a logo image to be responsive in theme’ is closed to new replies.