কম্পিউটার টিউটোরিয়াল

HTML DOM Style textOverflow প্রোপার্টি


DOM style textOverflow প্রোপার্টি HTML ডকুমেন্টে একটি এলিমেন্ট কন্টেইনারের বাইরে টেক্সট ফ্লো করলে কী হবে তা রিটার্ন ও প্রয়োগ করে।

সিনট্যাক্স

নিচে সিনট্যাক্স দেওয়া হলো:

  • textOverflow রিটার্ন করা

object.style.textOverflow
  • textOverflow পরিবর্তন করা

object.style.textOverflow = "value"

মানগুলো

এখানে, value হতে পারে:

মান ব্যাখ্যা
inherit এটি প্যারেন্ট এলিমেন্ট থেকে এই প্রোপার্টির মান ইনহেরিট করে।
initial এটি এই প্রোপার্টির মান ডিফল্ট ভ্যালুতে সেট করে।
clip এটি ওভারফ্লোইং টেক্সট ক্লিপ করে।
ellipsis এটি এলিমেন্টের ক্লিপ করা টেক্সট রিপ্রেজেন্ট করার জন্য এলিপসিস ("...") সেট করে।
string এটি এলিমেন্টের ক্লিপ করা টেক্সট রিপ্রেজেন্ট করার জন্য দেওয়া স্ট্রিং সেট করে।

উদাহরণ

Style textOverflow প্রোপার্টির একটি উদাহরণ দেখি:

<!DOCTYPE html> <html> <head> <style>    body {       color: #000;       background: lightblue;       height: 100vh;    }    p {       margin: 1.5rem auto;       border: 3px solid #fff;       width: 400px;       white-space: nowrap;       overflow: hidden;       text-overflow: visible;    }    .btn {       background: #db133a;       border: none;       height: 2rem;       border-radius: 2px;       width: 40%;       display: block;       color: #fff;       outline: none;       cursor: pointer;    } </style> </head> <body> <h1>DOM Style textOverflow Property Example</h1> <p>    This is paragraph 1 with some dummy text. This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text. This is paragraph 1 with some dummy text.    This is paragraph 1 with some dummy text. This is paragraph 1 with some dummy text. </p> <button onclick="add()" class="btn">Change textOverflow</button> <script>    function add() {       document.querySelector('p').style.textOverflow = "ellipsis";    } </script> </body> </html>

আউটপুট

এটি নিচের আউটপুট তৈরি করবে:

HTML DOM Style textOverflow প্রোপার্টি

Change textOverflow বাটনে ক্লিক করুন ওভারফ্লোইং প্যারাগ্রাফ টেক্সটের আচরণ পরিবর্তন করতে। এখানে এলিপসিস যোগ হবে।

HTML DOM Style textOverflow প্রোপার্টি


  1. HTML DOM Style textDecoration প্রোপার্টি

  2. HTML DOM Style whiteSpace প্রোপার্টি

  3. HTML DOM Style userSelect প্রপার্টি

  4. HTML DOM Style direction প্রপার্টি