The Big Spring Sale! Up to 50% off!

Font-size from px to em?

Smiley
4 Posts
Smiley posted this 23 February 2024
Ask a Question

To my understanding when using em's as the Font-size, the fonts would scale on the browser size.

Is it possible to change the Font-size from px to em? If yes, please advise from where.

To my understanding when using em's as the Font-size, the fonts would scale on the browser size. Is it possible to change the Font-size from **px to em**? If yes, please advise from where.
Vote to pay developers attention to this features or issue.
1 Reply
Order By: Standard | Newest
Support Team
Support Team posted this 23 February 2024

Hello Smileys,

Unfortunately, Nicepage doesn't directly offer a conversion feature for changing font sizes from px to em. However, you can try still to achieve this conversion manually through the following methods:

  • Select the text element you want to convert.
  • Right-click and choose "Inspect" (or use the keyboard shortcut).
  • In the developer tools, find the "font-size" property and the corresponding pixel value.
  • Divide the pixel value by your base font size (usually 16px in Nicepage).
  • Replace the pixel value with the calculated em value (e.g., if you have 12px and the base is 16px, replace it with 0.75em).
  • Repeat this process for all elements you want to convert.

Try Using CSS:

Paste the following code, replacing 16px with your actual base font size:

body {
font-size: 16px; /* Adjust this to your actual base font size */
}

.my-class {
font-size: 12px; /* Replace with your current px value */
}

.my-class {
font-size: 0.75em; /* Calculate the em value here */
}

  • Replace .my-class with the actual class name of your text element.
  • Calculate the em value based on your current px value and the base font size.

Before making any changes, create a backup of your website

Additional information can also be found at this link:

W3Schools px to em conversion table: https://www.w3schools.com/tags/ref_pxtoemconversion.asp
Dev Devout px to em converter: https://stackoverflow.com/questions/4575469/script-to-convert-css-sheet-from-px-to-em

To my understanding when using em's as the font size, the fonts would scale on the browser size.

This is not real, not true, if you set the my-text: 1em; it means the my-text will be 16px, and my text will be always 1em, it is not growing or shrinking itself, by the browser. If you want to use EM's for font size, you must write CSS, and you must write media query, em is better than px for responsive, if is easier to grow or shrink than PX but after adding CSS, after manipulation, itis not changing itself.

Please let us know if you have any further questions.
...................................................
Sincerely,
George.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello Smileys, Unfortunately, Nicepage doesn't directly offer a conversion feature for changing font sizes from px to em. However, you can try still to achieve this conversion manually through the following methods: - Select the text element you want to convert. - Right-click and choose "Inspect" (or use the keyboard shortcut). - In the developer tools, find the "font-size" property and the corresponding pixel value. - Divide the pixel value by your base font size (usually 16px in Nicepage). - Replace the pixel value with the calculated em value (e.g., if you have 12px and the base is 16px, replace it with 0.75em). - Repeat this process for all elements you want to convert. **Try Using CSS:** Paste the following code, replacing 16px with your actual base font size: body { font-size: 16px; /* Adjust this to your actual base font size */ } .my-class { font-size: 12px; /* Replace with your current px value */ } .my-class { font-size: 0.75em; /* Calculate the em value here */ } - Replace .my-class with the actual class name of your text element. - Calculate the em value based on your current px value and the base font size. **Before making any changes, create a backup of your website** Additional information can also be found at this link: W3Schools px to em conversion table: https://www.w3schools.com/tags/ref_pxtoemconversion.asp Dev Devout px to em converter: https://stackoverflow.com/questions/4575469/script-to-convert-css-sheet-from-px-to-em > **To my understanding when using em's as the font size, the fonts would scale on the browser size.** This is not real, not true, if you set the my-text: 1em; it means the my-text will be 16px, and my text will be always 1em, it is not growing or shrinking itself, by the browser. If you want to use EM's for font size, you must write CSS, and you must write media query, em is better than px for responsive, if is easier to grow or shrink than PX but after adding CSS, after manipulation, itis not changing itself. Please let us know if you have any further questions. ................................................... Sincerely, George. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp

Last edited 24 February 2024 by Support Team

You must log in or register to leave comments