1. jridgway
  2. Commercial Templates
  3. Sunday, 28 September 2014
  4.  Subscribe via email
This is a follow up to a couple of threads regarding re-sizing the logo in the Calibra template:
http://www.joomla51.com/forum/8-commercial-templates/5358-calibra-mobile-logo#11185
http://www.joomla51.com/forum/8-commercial-templates/5523-calibra-mobile-view#11658

and the tutorial at these links:
http://www.joomla51.com/tutorials/item/re-sizing-your-logo-for-smaller-screen-devices

I was still getting the horizontal scrolling on small screens because the width property on the logo tab of the template was defining the width of the logo container which remained wider than the screen on small screens.

My logo graphic is 720px wide so I had to define the width on the logo tab as 720px, otherwise it gets clipped on larger screens. However, this results in the horizontal scrolling on small screens even though the logo graphic is scaled down.

So I'm posting my solution here for the benefit of other users. I don't know if there is a way to shorten this code or not but it works for me. This provides two steps in scaling the logo down. You can add additional steps by duplicating the sections for each additional step. Just be sure to add both a logo scaling section and a logo container scaling section.

The site is at http://www.prairielawgroup.com


/*This section scales the logo to 450 px on screens less than 768px*/
@media only screen and (max-width: 767px) {
h1.logo a {
background-size: 450px auto;
}}
/*This section scales the logo to 300 px on screens less than 440px*/
@media only screen and (max-width: 440px) {
h1.logo a {
background-size: 300px auto;
}}
/*This section scales the logo container to 450px on screens less than 768px to solve the horizontal scrolling problem */
@media only screen and ( max-width: 767px ) {
.logo_container, h1.logo, h1.logo a, #logo {
width: 450px !important;
}}
/*This section scales the logo container to 310px on screens less than 440px to solve the horizontal scrolling problem */
@media only screen and ( max-width: 440px ) {
.logo_container, h1.logo, h1.logo a, #logo {
width: 310px !important;
}}


I hope this helps!
Credit to Ciaran for these solutions in various threads! I just put them all together in one location after much trial and error.
Accepted Answer Pending Moderation
0
Votes
Undo
Thank you for sharing :) :)

CiarĂ¡n
  1. more than a month ago
  2. Commercial Templates
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!

Join Our Newsletter

* indicates required
We respect your privacy and do not tolerate spam and will never sell, rent, lease or give away your information (name, email, number, etc.) to any third party. Nor will we send you unsolicited email.
Joomla51 - Mullaghmore, Co. Sligo, Ireland
Joomla51.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by
Open Source Matters
the trademark holder in the United States and other countries.

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.

Ok