margin-top property এলিমেন্টের উপরের মার্জিন নির্দিষ্ট করে। মান লেংথ, পারসেন্টেজ বা auto হতে পারে।
উদাহরণ
নিচের কোডটি রান করে উপরের মার্জিন সেট করার পদ্ধতি শিখুন:
<html>
<head>
</head>
<body>
<p style="margin-top: 10px; border:2px solid red;">
This is a paragraph with a specified top margin </p>
<p style="margin-top: 10%; border:2px solid green;">
This is another paragraph with a specified top margin in percent </p>
</body>
</html>
মার্জিন কলাপ্স (Margin Collapse): সংলগ্ন এলিমেন্টের ভার্টিক্যাল মার্জিন (top/bottom) একত্রিত হয়ে বড়টি মানটি প্রয়োগ হয়। এটি বোঝা লেআউট ডিবাগিং-এ গুরুত্বপূর্ণ।