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 9177255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:16:56+00:00 2026-06-17T17:16:56+00:00

Can I override the fixed font size of a parent element (e.g. div) with

  • 0

Can I override the fixed font size of a parent element (e.g. div) with a non-fixed font size.
I have a problem where for a particular HTML page, I would like the element to use a font size relative to the Body element and not relative to the parent div.

My HTML

<body id="templateBody">
    <div>
         <p>

My CSS

body{
  font-size: 76%
}

div{
  font-size:11px
}

How do I specify a font size for p so that it is relative (%age) of the Body font size and not the fixed div font size? Is there anyway to override the div’s fixed font size without changing the div’s style? I tried using rem, but it does not work on IE8…

  • 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-17T17:16:57+00:00Added an answer on June 17, 2026 at 5:16 pm

    You cannot. Once you have set the parent element’s font size, there is no way of referring the font size of the parent’s parent.

    The rem unit, in addition to browser support issues, refers to the font size of the root element, which is always the html element in HTML documents. So if the the body font size is set as a percentage, you could indirectly set the p font size as relative to it, but only in the sense of setting it as relative to the root element’s font size.

    There is normally little sense in mixing px and % font sizes in a document.

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

Sidebar

Related Questions

In Kohana 2 you can override the default error page by creating a custom
Evening, I'm facing a small problem which I can't get fixed. I'm having one
I know you can override delete and save methods in DJango models, but can
I wondered if/how I can override the default [Authorize] behavior in ASP.NET MVC. I
I was wondering if I can override the action of the back and home
I'm not sure what it's called but you can override methods easily with: Apple
To detect rotation of the mouse wheel in .NET/WinForms, I can override OnMouseWheel .
ObjC has a very unique way of overriding methods. Specifically, that you can override
Can you override method in java without using annotations? Because eclipse doesn't support it
can i override Convert.ToDateTime() ? I don't want 100 times or more check if

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.