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

  • Home
  • SEARCH
  • 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 6831819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:46:58+00:00 2026-05-26T22:46:58+00:00

If I style an <h1> element with padding: 1.2em or padding: 10% , is

  • 0

If I style an <h1> element with padding: 1.2em or padding: 10%, is that relative to the:

  1. font-size of the <h1> element?
  2. height of the <h1> element?
  3. padding of the parent element?
  4. something else?

And is it different for em and %?

  • 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-05-26T22:46:59+00:00Added an answer on May 26, 2026 at 10:46 pm

    It is indeed different for em and %:

    Ems

    The padding size is relative to the calculated font size of that element.

    So, if your <h1>’s calculated font size is 16px, then 1.2 ems of padding = 1.2 × 16 pixels = 19.2 pixels.

    Percentages

    The padding size is relative to the width of that element’s content area (i.e. the width inside, and not including, the padding, border and margin of the element).

    So, if your <h1> is 500px wide, 10% padding = 0.1 × 500 pixels = 50 pixels.

    (Note that top and bottom padding will also be 10% of the width of the element, not 10% of the height of the element.)

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

Sidebar

Related Questions

I want to unselected selected li by click other element.E.g: <style> #feedback { font-size:
I want to have a element that displays in the multiple selection display style
this is my code : <style type=text/css> #draggable { width: 100px; height: 100px; padding:
I have bulk of html file like this <div style=min-height: 32px; padding: 5px; width:
I have a ugly block of css declarations. ol{margin:0;padding:0}p{margin:0}.c5{width:468.0pt;background-color:#ffffff;padding:72.0pt 72.0pt 72.0pt 72.0pt}.c4{font-size:24pt;font-weight:bold}.c3{margin:0;padding:0}.c0{direction:ltr}.c1{height:11pt}.c2{font-style:italic}body{color:#000000;font-size:11pt;font-family:Arial}h1{padding-top:24.0pt;color:#000000;font-size:24pt;font-family:Arial;font-weight:bold;padding-bottom:6.0pt}h2{padding-top:18.0pt;color:#000000;font-size:18pt;font-family:Arial;font-weight:bold;padding-bottom:4.0pt}h3{padding-top:14.0pt;color:#000000;font-size:14pt;font-family:Arial;font-weight:bold;padding-bottom:4.0pt}h4{padding-top:12.0pt;color:#000000;font-size:12pt;font-family:Arial;font-weight:bold;padding-bottom:2.0pt}h5{padding-top:11.0pt;color:#000000;font-size:11pt;font-family:Arial;font-weight:bold;padding-bottom:2.0pt}h6{padding-top:10.0pt;color:#000000;font-size:10pt;font-family:Arial;font-weight:bold;padding-bottom:2.0pt} Client-side, I
I need to get position of element relative to its parent. position() is suppose
Is there a simple way to style element like this? Supposed to be used
I would like to select an element on its style element. For example, my
Can anyone explain to me why can we style the element html ? What
Found this rather strange bug in IE8; element.style.top is limited to 1342177 pixels. Even

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.