Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

changing Font size in html style attribute

difference between both and why we use the % symbol and what does it means?

<p style="font-size:160%;">This is a paragraph.</p>

<p>This is a paragraph.</p>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The first one has the style attribute (CSS) of font-size:160% it sets the font-size property to 160%.
% is a relative CSS unit, it will set the font size to 160 percentage of the parent element.

<div style="font-size:24px;">
  <p style="font-size:160%;">This is a paragraph with 160% of the font size of parent div</p>
  <p>This is a paragraph with the font size of the parent div</p>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading