ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the difference between px,em and percentage in css?

user-image
تم إضافة السؤال من قبل Saurav Kumar
تاريخ النشر: 2016/05/13
Sri harsha vardhan Akula
من قبل Sri harsha vardhan Akula , Software Engineer , Veniso Solutions

Pixels (px):

px are browser dependent. It is the absolute size that you would see on your screen.

 

em:

 

Em are sort of like percentages. Ems is referring to the base text size. The value of 1 emmeans the same thing as a value of 100 percent. But you can also say it in the opposite way: A percentage value is just an em multiplied by 100.

Ehsan Ansari
من قبل Ehsan Ansari , Marketing Specialist , Galadari Trucks And Heavy Equipment (JCB)

px stands for pixels, generally use to define dimensions for fonts, pictures, tags, Divs, etc in absolute terms

em is used for sizing fonts in multiple values of the set font size. If font size is set to 12px, it will be 1 em. 2em will be twice the size of the set font i.e 24 px

percentages are generally used for responsive webdesigns to accommodate the design/fonts as per the screen size.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟