ওয়েব ডিজাইন (পর্ব ১৫) ম্যাক্স ওয়াইড, ডিসপ্লে, পজিশোন, অভারফ্লো, ফ্লোট - WikiJana.Com™

ওয়েব ডিজাইন (পর্ব ১৫) ম্যাক্স ওয়াইড, ডিসপ্লে, পজিশোন, অভারফ্লো, ফ্লোট

max width টা আসলে ব্যবহার হয়ে থাকে আপনার সাইট কে রেসপন্সিভ করার জন্য। প্রোপার্টি ইউজ করলে আপনার সাইটের ডিজাইনকে নির্দিষ্ট মাপের রেসপন্সিভ করতে পারবেন।
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

আস্‌সালামু আলাইকুম! আশা করি আল্লাহ এর অশেষ রহমতে আপনারা সবাই ভালো আছেন।আমিও আপনাদের দোয়াই ভালো আছি। আজকের নতুন টপিকে আপনাকে স্বাগতম! আজকে আপনাদের দেখাবো ম্যাক্স ওয়াইড, ডিসপ্লে, পজিশোন, অভারফ্লো, ফ্লোট।

ম্যাক্স ওয়াইডঃ

max width টা আসলে ব্যবহার হয়ে থাকে আপনার সাইট কে রেসপন্সিভ করার জন্য। প্রোপার্টি ইউজ করলে আপনার সাইটের ডিজাইনকে নির্দিষ্ট মাপের রেসপন্সিভ করতে পারবেন।এই জন্য max-width এর গুরুত্ব অনেক।

নিচের কোডে nores ক্লাসে শুধু width প্রোপার্টি ইউজ করা হয়েছে আর res ক্লাসে max-width প্রোপার্টি ইউজ করা হয়েছে।
<style>
.nores {
  width:500px;
  margin: auto;
  border: 3px solid #000;
}

.res {
  max-width:500px;
  margin: auto;
  border: 3px solid #ff0000;
}
</style>
<div class="nores">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.</div>
<br>
<div class="res">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.</div>
এখানে দুইটা ক্লাসের width মাপ একই দেওয়া হয়েছে যার কারনে nores ক্লাসে  নির্দিষ্ট পর্যন্ত সাইজ আসবে।এবং res ক্লাসে নির্দিষ্ট সাইজ পরে অটোমেটিক ছোট হতে থাকবে।

ডিসপ্লেঃ

CSS Display এর প্রধান কাজ আমাদের লেআউট কে কন্ট্রোল করা।এইটা খুবই গুরুত্বপূর্ণ ।

Display প্রোপার্টি এর ব্লক  লেভেল ও ইনলাইন এলিমেন্ট কি কিঃ

ব্লক লেভেল এলিমেন্টঃ

Block-level এলিমেন্ট গুলো পুরো width এর জায়গা নিয়ে নেয়।
  • <div>
  • <h1> - <h6>
  • <p>
  • <form>
  • <header>
  • <footer>
  • <section>

ইনলাইন এলিমেন্টঃ

inline element গুলো একই লাইনে অবস্থান করতে পারে।
  • <span>
  • <a>
  • <img>
আমি নিচের কোডে দেখানোর চেস্টা করেছি div যদিও Block Element তবুও কিভাবে আপনারা CSS এর মাধ্যমে inline এলিমেন্ট বানিয়ে ফেলবেন।
    
      <style>
    div {
    display:inline;
    }
    </style>
    <span> This is inline </span>
    <div> it's block element but css use inline</div>

    Display None:

    ডিসপ্লে নান করা মানে কোনো কোড লিখে সেইটা কে যদি আমাদের ওয়েব পেজে দেখাতে না চাই বা কোনো নির্দিষ্ট কারনে দেখাতে চায়। তবেই এই  display:none করার প্রয়োজন পড়ে।
    <style>
    div {
    display:none;
    }
    </style>
    <span> This is no none </span>
    <div> it's display none</div>

    পজিশনঃ

    CSS এর আরেকটি গুরুত্বপূর্ণ প্রোপার্টি হলো পজিশন।পজিশন দিয়ে আমরা আমাদের সাইটের ডিজাইন জায়গা মতো স্থাপন করতে পারি। নয়তো সম্ভব না।

    পোজিশন প্রোপার্টিতে যে সব ভেলু ইউজ হয়ে থাকে তা হলোঃ
    • static = এইটা ডিফল্ট। এইটা সাধারণত ইউজ করলেও যেমন ছিলো তেমন ই থাকে।তবে কিছু ক্ষেত্রে এইটা ব্যবহারের দরকার হয়।
    • relative = রিলেটিভ Static এর মতোই তবে top, right, bottom, right ব্যবহার করে নিজস্ব অবস্থানের ভিতরে সরানো যাবে।
    • absolute =  নির্দিষ্ট  Div এর ভিতরে অবস্থান করবে।যদি কোনো নির্দিষ্ট  ডিভ এর ভিতরে  না থাকে তবে <html> কে অনুসরণ করে অবস্থান করবে এবং অবস্থান পরিবর্তন করবে।
    • fixed = এটা সব সময় নির্দিষ্ট জায়গায় অবস্থান করে।স্ক্রল করলেও Fixed জায়গা থেকে সরে না।
    • sticky = এইটা আমাদের স্ক্রলিং এর পজিশন নিশ্চিত করে।নির্দিষ্ট জায়গা থেকে sticky করা সম্ভব।
    আমরা এখন Relative এবং Absolute ব্যবহার করে বাংলাদেশ এর পতাকা বানানো দেখবো যতে করে আপনাদের এই সম্পর্কে পরিস্কার ধারনা তৈরি হয়।
    <style>.flag{
      background:green;
      width:600px;
      height:350px;
      position:relative;
    }
    .red{
      background:red;
      width:180px;
      height:180px;
      right:0px;
      left:0px;
      top:0px;
      bottom:0px;
      margin:auto;
      position:absolute;
      border-radius:100%;
    }
    </style>
    <div class="flag"><div class="red"></div></div>

    Sticky Vs Fixed

    প্রায় একই রকম মনে হতে পারে । তবে দুইটার কাজ আলাদা। Sticky ভেলু সব সময় স্ক্রলিং পজিশন অনুয়ায়ী সরে। আর Fixed স্ক্রলিং এর সময়  একই জায়গায় অবস্থান করে ।
    নিচের কোডে লক্ষ করুন এবং sticky ও Fixed এর তফাত বুঝতে Position প্রোপার্টি এর ভেলু Sticky চেন্জ করে Fixed করে দেখুন।
    <style>
    .sticky {
      position: sticky;
      padding: 10px;
      top: 0;
      background-color: #eee;
      border: 2px solid #000;
    }
    .large-bottom{
    padding-bottom:2000px;
    }
    </style>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum</p>
    <div class="sticky">Sticky Code</div>
    <div class="large-bottom">
      <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
      <p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
    </p>
    </div>

    CSS অভার ফ্লোঃ

    নির্দিষ্ট মাপের অতিরিক্ত কন্টেন্ট গুলো সাধারনত মাপের বাইরে অবস্থান করে।আর এই সমস্যা সমাধানের জন্য এই অভার overflow ইউজ করা হয়।
    • visible = এইটা ডিফল্ট ভাবেই থাকে।
    • hidden = এইটা ইউজ করলে আপনার মাপের বাইরে কিছু দেখা যাবেনা। তা হাইড হয়ে যাবে।
    • scroll = স্ক্রোল ইউজ করলে  মাপের বেশি হলে স্ক্রলিং হবে।
    • auto = এই টাও সাধারণত স্ক্রোলিং হবে।তবে এইটা প্রয়োজন অনুযায়ী 
    নিচের কোড ট্রাই করার সময় আলাদা ভেলু ইউজ লিখবেন।
    <style>
    div {
      width: 300px;
      height: 100px; 
      overflow: visible;
      border: 1px dotted black;
      background-color: #ffcccc;}
    </style>
    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>

    CSS ফ্লোটঃ

    লেআউট তৈরি করার জন্য ফ্লোট খুব গুরুত্বপূর্ণটা একটা বিষয়।আমরা আমাদের কন্টেন্ট কে সাজাতে অর্থাৎ কোনটা কোন পাশে রাখবো তা নিশ্চিৎ করতে এই সিএসএস ফ্লোট ব্যবহার করা হয়।
     একই সাথে লেখা বা ছবি পাশাপাশি রাখতে ফ্লট ব্যবহার করা হয়।

    Float প্রোপার্টি এর ভেলুঃ

    • left - এটা দিয়ে বাম পাশে ফ্লটে নেওয়া হয়।
    • right - এটা দিয়ে ডান পাশের ফ্লটে নেওয়া হয়।
    • none - এইটা কোনো ফ্লট না । এটা ডিফল্ট।
    ফল্ট যখন আলাদা করা হয় তখন খালি জায়গা গুলোতে নিচের কন্টেন্ট গুলো চলে আসে।আর তখন আমাদের ওই গুলো ক্লিয়ার করতে হয়।

    Clear প্রোপার্টি এর ভেলুঃ

    • none - এইটা ডিফল্ট।
    • left - এটা শুধু বাম পাশ ক্লিয়ার করবে।
    • right- এটা শুধু ডান পাশ ক্লিয়ার করবে।
    • both - এইটা উভয় পাশ ক্লিয়ার করবে।
    নিচের কোড গুলো ট্রাই করুন।
    <style>
    .red{
    width:100px;
    height:100px;
    background-color:red;
    float:left;
    }
    .green{
    width:100px;
    height:100px;
    background-color:green;
    float:right;
    }
    p{
    clear:both;
    }
    </style>
    
    <div class="red"></div>
    <div class="green"></div>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </p>
    
    নিচের কোডে একটা লেআউট কিভাবে তৈরি করা হয়। তার নমুনা কোড দেওয়া হলো ওগুলো ট্রাই করুন। আশা করি বুঝতে পারবে
    <style>
    .header{
        float:left;
        width : 100%;
        border: 1px solid;
        height: 100px;
    }
    .left_menu{
        width : 24.999%;
        float:left;
        border: 1px solid;
        height: 250px;
        clear: both;
    }
    .content{
       float: left;
       width: 74%;
       border: 1px solid;
       height: 250px;
       
    }
    .footer{
       float:left;
       width:100%;
       border: 1px solid;
       height: 100px;
    }
    
    </style>
    
    <div class="header">Header</div>
      <div class="left_menu">Left Menu</div>
      <div class="content">Main Content</div>
    <div class="footer">Footer</div>
    

     এই আর্টিকেল টি পুরোটা পড়ার জন্য আপনাকে অনেক ধন্যবাদ, এই আর্টিকেল যদি বুঝতে অসুবিধা হয় অথবা কোনো প্রশ্ন থাকে তবে কমেন্ট করুন, আশা করি আপনি উত্তর পাবেন।আর নতুুন কিছু জানার থাকলে আমাদের জানান আমরা জানানোর চেস্টা করবো। এই আর্টিকেলটি WikiJana.Com সাইটের সম্পদ তাই যদি কেউ কপি করেন তবে আপনারা অবশ্যই ক্রেডিট দিবেন নয়ত আপনার সাইট কপিরাইটের অধিনে চলে যেতে পারে।

    About the Author

    I am a web designer and developer. I regularly work for different companies. I try to write a little on this blog when I have time. If you can learn something from this blog, then I will be successful.
    I have a blog for learning web design, the nam…

    একটি মন্তব্য পোস্ট করুন

    কোনো প্রশ্ন থাকলে অনুগ্রহ করে বিস্তারিত ভাবে বলুন, আশা করি আমরা আপনাকে হেল্প করতে পারবো।তবে অনুগ্রহ করে স্পাম করবেন না।
    একটি মন্তব্য পোস্ট করুন

    All information presented on this website is collected from internet. We may make unintentional mistakes while writing the post. We sincerely apologize for any unpleasant mistakes and WikiJana.Com is not responsible for any incorrect information. If you see any incorrect information please let us know immediately. We will try to fix it as soon as possible. Click here to report.

    Oops!
    It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
    AdBlock Detected!
    We have detected that you are using adblocking plugin in your browser.
    The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
    Site is Blocked
    Sorry! This site is not available in your country.