Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7864353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:45:41+00:00 2026-06-02T23:45:41+00:00

working on converting our company site over to something more responsive so reworking the

  • 0

working on converting our company site over to something more responsive so reworking the css to use em‘s instead of the tried and true px.

The problem i’m running into is the inheritance of font-size and am looking for best practices for this issue.

This is how I’m solving the problem as of now.

jsfiddle for your viewing pleasure

HTML

<h3>Heading with a <a href="#">Link</a></h3>

<p>this is a paragraph with a <a href="#">Link</a> inside of it</p>
<a href="#">this is a link outside the paragraph</a>​

CSS

body {font:normal 100% sans-serif;}
p {font:normal 1.5em sans-serif; margin-bottom:.5em;}
h3 {font:bold 3em serif; margin-bottom:.5em; }
a:link {font-size:1.5em;}

p a, li a, h1 a, h2 a, h3 a, h4 a, h5 a,
h6 a, dl a, blockquote a, dt a, dd a, td a {
    font-size:1em !important;
}

I understand that em‘s are related to the parent font-size. so if I set p{font-size:1.5em;} and also set a:link{font-size:1.5em;} and my <a> is outside of my <p> then they will have the same relative size, great.

But if i then place an <a> inside a <p> the font size of the embedded <a> is now larger as it is 1.5em‘s larger than the <p>. To overcome this I set the last style with a string of p a, li a, h1 a,......{font-size:1em !important;}. Since a:link has a higher specificity than just p a i had to use !important (not a fan of !important), also i can’t use font-size:inherit; as we have to support, dare i say it, ie6 (still have 15% traffic, we are biotech and some companies just refuse to upgrade).

So my question to you is this. Am I going about this the right way in tackling tags inside of tags to prevent my typography from breaking up? As soon as i wrote the last style i thought to myself, this can become a nightmare to maintain! I would like to use rem but the browser support isn’t there for a portion of users.

How do you solve this problem in your own css and what would be a “best practices” approach to this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:45:43+00:00Added an answer on June 2, 2026 at 11:45 pm

    Set font size for blocks only, such as headings and navigation blocks. Changing font inline causes a mess, so just don’t set font size for, say, links. Instead, when desired, set the font size of a ul or div or other element that contains navigation links.

    In general, use as few font-size settings as possible, to minimize risks of unwanted cumulative effects.

    Notes:

    This is not about inheritance at all. When you set font-size on an element, the element certainly does not inherit font size. This is about the effect of the relative nature of the em unit.

    Should you have set a:link{font-size:1.5em;} for example, you can easily override it for links inside paragraphs without using !important. You just have to be more specific, and the natural way here would be p a:link{font-size:1em;}.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently working with converting SQLException error messages into messages that are more useful for
I'm working on converting some NSURLConnection code over to AFNetworking and I'm seeing a
I'm working on converting an old define()-based language/translation system to a more flexible one
I'm working on automating our company invoicing system. Currently all data is stored in
I'm working on converting an old C program (currently run on UNIX) into our
I have been working on converting my websites session information over from flatfiles to
I'm working on converting a human readable time to a datetime object . In
I am currently working on converting a ColdFusion website, using Fusebox framework, to PHP.
I'm working on converting a project from Visual Studio 2008 to 2010 and came
I'm working on converting a very simple java desktop application to run in java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.