কম্পিউটার

CSS এ Em দিয়ে ফন্ট সাইজ সেট করা


CSS-এ ফন্ট-সাইজ প্রপার্টি সেট করতে, আপনি em ব্যবহার করতে পারেন। যখন আপনার পাঠ্যের জন্য পিক্সেল নির্ভুলতা প্রয়োজন তখন এটি উপকারী। ডিফল্টরূপে 1em =16px, এবং 2em =32px।

উদাহরণ

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   text-decoration: overline;
   text-decoration-color: yellow;
   font-size: 1.3em;
}
</style>
</head>
<body>
<h1>Examination Details</h1>
<p class="demo">Exam on 20th December.</p>
<p class="demo2">Exam begins at 9AM.</p>
</body>
</html>

আউটপুট

CSS এ Em দিয়ে ফন্ট সাইজ সেট করা

উদাহরণ

এখন আরেকটি উদাহরণ দেখা যাক -

<!DOCTYPE html>
<html>
<head>
<style>
div {
   text-align: justify;
   text-justify: inter-word;
   color: white;
   background-color: gray;
   font-size: 1.5em;
}
</style>
</head>
<body>
<h2>Demo Heading</h2>
<div>This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div>
</body>
</html>

আউটপুট

CSS এ Em দিয়ে ফন্ট সাইজ সেট করা


  1. টেক্সট ইন্ডেন্টেশন CSS এর সাথে কাজ করছে

  2. CSS ব্যবহার করে Em এর সাথে ফন্ট সাইজ সেট করা

  3. CSS ব্যবহার করে কীওয়ার্ডের সাথে ফন্ট সাইজ সেট করা

  4. CSS-এ ফন্ট সাইজ