Jump to content

Archived

This topic is now archived and is closed to further replies.

mpturner

Masthead Font Changes = Non-Responsive

Recommended Posts

mpturner

Hi all,

 

By default, the Masthead font reduces perfectly on the iPhone, for example. But when I edit the size of the font within CSS, it becomes non-responsive. I've also tried using percentages to no avail. As you can see from my CSS below, I am attempting to make the title smaller and the tagline larger, yet keep it all responsive.

 

Thanks much,

Michael

 

.masthead {
  margin-bottom: 0px !important;
}
 
.masthead .masthead-title {
  color: #4E4F4F !important;
  font-size: 56px !important;  
}
 
.masthead .masthead-tag {
  color: #4E4F4F !important;
  opacity: 1.0 !important;
  font-size: 36px !important;
}
 

Share this post


Link to post
Share on other sites
Danny
Hi, This is because by default when you resize your browser the Masthead title is resized using @media queries. Therefore, if you change the font size of the Masthead title, you will also need to do the same i.e. change the font size via @media. Below is the default code for the Masthead and its @media queries.
.masthead .masthead-title {
margin-bottom: 9px;
font-size: 81px;
letter-spacing: -1px;
line-height: 1;
margin-bottom: 18px;
}

@media screen and (max-width: 980px)
.masthead .masthead-title {
font-size: 72px;
}

@media screen and (max-width: 768px)
.masthead .masthead-title {
font-size: 54px;
}

@media screen and (max-width: 480px)
.masthead .masthead-title {
font-size: 45px;
margin-right: 0;
}

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
mpturner

Thanks Danny, however I am confused.

 

In your code above, if I only change the first size (81px) to say... 56px... and don't touch the @media sections, shouldn't those @media options still work as-is since they aren't percentages of the 81px... they are what they are in pixels? I ask, because the font sizes that render on the iPhone are perfect as-is. I only want the desktop version to change, but when I do that, it's breaking the mobile font resizing.

 

Thanks for the help,

Michael

Share this post


Link to post
Share on other sites
Rob

Use em or percent sizing, instead of px.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
mpturner

I've tried that, Rob, but no love. I guess I need to read-up on my CSS knowledge. I'm just not getting why changing the primary font size would even impact the @media queries when they have their own font-size that should override any other font settings, provided the screen size matches. But no matter what I do to that very first font-size -- the 81px code -- it ruins responsiveness on the iPhone.

Share this post


Link to post
Share on other sites
Danny

Its most likely that your custom code, is overriding the @media queries and therefore, the @media CSS isn't being used. The best thing to do is, add your own @media queries.

 

The code I provided above will assist you in creating your own @media.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Frederic

Hi Danny

 

I have read the above codes and found them great as i was also wondering why fonts do not resize when going on ipad or smaller screen.

 

So I will definitely try that.

 

You gave an example for   .masthead .masthead-title 

 

Do I use the same @media screen and (max-width: 768px) with titles in highlight, hero and icall?

 

I have 

.pl-hero-wrap .pl-hero h1   for Hero

.section-highlight .highlight-head   for Highlight

.section-icallout .icallout-head   for iCall

 

Is that ok using:

@media screen and (max-width: 980px)
.section-icallout .icallout-head {
font-size: 72px;
}

@media screen and (max-width: 768px)
.section-icallout .icallout-head {
font-size: 54px;
}

@media screen and (max-width: 480px)
.section-icallout .icallout-head {
font-size: 45px;
margin-right: 0;
}

 

I assume there is not need to do that for the taglines - they would end up too small

Share this post


Link to post
Share on other sites
Danny

I haven't checked your code personally as we do not provide assistance to custom code. However, it looks about right, if it doesn't work you may want to prefix your code with one of the PageLines override which are available on our custom CSS documentation.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • chamois_blanc
      By chamois_blanc+
      Hello,
      Shouldn't the image PL5 component be using the srcset/picture css directives to pick the correct size for an image? or it does already and I don't know how to use it? Thank you for any advice or enlightenment.
    • stijnxo
      By stijnxo+
      Is there a way to disable the responsive function of your iBoxes?
      I do not want all iBoxes underneath each other on mobile, is there a way to fix columns or group boxes?
      I use them for small links and want them to stay next to each other, see attachment
      Please let me know.



    • Dan Haddock
      By Dan Haddock
      Plugins Active and installed: 
      Akismet Anti-Spam
      Coming Soon Page & Maintenance Mode by SeedProd
      Contact Form 7
      Cookie Law Info
      DMS Professional Tools  
      Enhanced Media Library  
      Flamingo
      Google Analytics for WordPress by MonsterInsights
      Google XML Sitemap
      Jetpack by WordPress.com
      Legull 
      Loginizer   
      MailChimp for WordPress
      PageLines Updater    
      Schema App Structured Data 
      Sucuri Security - Auditing, Malware Scanner and Hardening
      Uber reCaptcha    
      Yoast SEO
      Wordpress Version: 4.8.1
      Pagelines Version: 2.2.4
       
      Good Evening/Afternoon or Morning, 
      I am running into a problem with CSS styling not applying inside of most browsers (Safari, Firefox) when I am logged in to wordpress, and all browsers that I have tested when I am logged off and the site has been made public (Chrome, Firefox and Safari).
      As a result, I have managed to identify the probable cause. It looks as though these browsers are refusing to render my sites compiled CSS file due to it being a HTTP URL rather than HTTPS.
      I have attempted to change this URL to HTTPS in my browser, however it brings back an ERROR: File not found page - https://www.shortfilmblog.com/wp-content/uploads/pagelines/compiled-css-core-1505847507.css
      What would you suggest in this regard? Would this be resolvable from your end?
      Happy to provide any further details required.
    • Borries
      By Borries+
      I know this is not an easy problem. Maybe there is a easy solution.
      I have tryed to uses the existing solution, that I have found in the forum
      I changed the colours of my nav (simple nav) and the hover effect (a. hover).
      I really tryed to highlight the active/used link in the nav but I cant figure it out.
      I want it to be black when active.
      Any help would be appreciated. Thanks.
      http://www.marcborries.de  nav link: "Sinn & Selbst" 
    • lionel1
      By lionel1
      Hi,
      I use on my home page " impulse module " but when i look on my iPhone the image is cut and not responsive .
      i only have this problem with this module not with the other one .
      thanks for ur help
      website / www.elonakane.com 
      Lionel 
       
×