• 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

Why use both px and rem in font-size?

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 › Why use both px and rem in font-size?

This topic is: not resolved

Tagged: font size, px and rem

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 1 month ago by CharlieL.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 4, 2016 at 3:40 pm #197013
    CharlieL
    Participant

    When adopting the Enterprise-pro theme to client needs I studied some other themes
    regarding font-size.

    In order to learn more, I studied the CSS for one of the latest themes: Infinity Pro, and I
    found that the font-size was set twice in both px and rem
    Like this:

    body {
    	background-color: #fff;
    	color: #000;
    	font-family: 'Cormorant Garamond', serif;
    	font-size: 22px;
    	font-size: 2.2rem;
    	font-weight: 400;
    	line-height: 1.75;
    	margin: 0;
    } 

    This reappears in h1 -- h6 and other special texts.

    It would have been very interesting to get some insight into why it
    is written that way and also if the order between px and rem is critical.
    Could you please reveal some reasons for making it that way?

    December 4, 2016 at 6:02 pm #197020
    Susan
    Moderator

    I believe it's related to accessibility and for font rendering on newer browsers versus older browsers. I got that information from here (link)

    Here's further discussion on the subject: https://webdesign.tutsplus.com/tutorials/comprehensive-guide-when-to-use-em-vs-rem--cms-23984

    In terms of order, you will find that the StudioPress themes place elements in alphabetical order, so px displays before rem. It's not critical that it is in alphabetical order - it's just neater 🙂

    December 5, 2016 at 6:35 am #197042
    CharlieL
    Participant

    Thanks, Susan for the useful links! Yes, it seems to be issues with IE that causes this doubling of measures.
    There was one comment in the first link saying: "the only real reason to use (r)em is so IE users can resize
    the text?" But other comments bring a lot of confusion to which strategy to follow.

    Therefore it would have been interesting to hear the incitement for the developers of the Infinity Pro theme
    to use both measures, or maybe that´s against their policy. However, it is always better to have some deeper
    insights on the themes one is working with. It is of great value when choosing a theme for a new site.

    The tutsplus.com-link was also good. I have to read it again to fully comprehend the content. I have not used rem
    before so there are some new things to me to be used to.

    Thank you, Susan, for commenting.

  • 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

© 2026 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