অবস্থান (Positioning) | সি এস এস বাংলা টিউটোরিয়াল

অবস্থান (Positioning)

ওয়েব পেজে বিভিন্ন HTML উপাদান সমূহ কোথায় কিভাবে প্রদর্শিত হবে তা প্রকাশ করার জন্য position প্রোপার্টি ব্যবহার করা হয়। এর সাথে top, bottom, left, and right প্রোপার্টি সমূহ ব্যবহার করে কোন HTML উপাদানের প্রকৃত অবস্থান নির্ধারণ করা হয়। position প্রোপার্টির চার ধরণের মান হতে পারে। এগুলো হচ্ছে,

  • পজিশন স্ট্যাটিক (position:static)
  • পজিশন ফিক্সড (position:fixed)
  • পজিশন রিলেটিভ (position:relative)
  • পজিশন এবসলিউট (position:absolute)

অনুশীলন প্রজেক্ট

<html>
<head>
<title> www.tutohost.com</title>
<style>
body{background:#FFC}
h1 {
color:#F09;
background:#CC9;
padding:10px;
border:#960 1px solid; }
#static{
position:static;
left:100px;
top:70px;}
#absolute{position: absolute;
left:150px;
top:100px;}
#fixed{position: fixed;
left:0px;
top:70px;}
#relative{position: relative;
left:150px;
top:100px;}
p{background:#FCF;
padding:10px;
border:#F09 1px solid;}
</style>

</head>
<body >
<h1 id="static">Position static</h1>
<h1 id="absolute">Position absolute</h1>
<h1 id="fixed">Position fixed</h1>
<h1 id="relative">Position relative</h1>
<p>We are bangladeshi Hostgator hosting provider. The world wide technical and support team is working for your best movement.We are bangladeshi Hostgator hosting provider. The world wide technical and support team is working for your best movement.We are bangladeshi Hostgator hosting provider. The world wide technical and support team is working for your best movement. </p>
</body>
</html>

একটা  নোটপ্যাড  open  করে  উপরের code  টুকু  লিখে  file  মেনু  থেকে  Save as এ ক্লিক করে File name:  index.html  ,   Save as type : All files,  দিয়ে save করে index.html ফাইলটি Mozilla Firefox দিয়ে open করলে নিচে প্রদর্শিত ছবির মত দেখাবে।


লেখকঃ অসীম কুমার
তিনি ইলেকট্রিক্যাল ইঞ্জিনিয়ারিং এ লেখাপড়া করছেন। টিউটোরিয়ালবিডি ও বিজ্ঞানপ্রযুক্তি ব্লগে তিনি ইলেক্ট্রনিক্স সহ বিভিন্ন টেকনোলজি বিষয়ে লিখে থাকেন। বর্তমানে তিনি লেখাপড়ার পাশাপাশি টিউটোহোস্টে কর্মরত আছেন।

কপি রাইট © ২০১১থেকে যতদিন চলবে সর্বস্বত্ত্ব সংরক্ষিত