DOM style textIndent প্রোপার্টি HTML ডকুমেন্টে একটি এলিমেন্টের টেক্সটের প্রথম লাইনের ইন্ডেন্টেশন রিটার্ন ও পরিবর্তন করে।
সিনট্যাক্স
নিচে সিনট্যাক্স দেওয়া হলো:
textIndent রিটার্ন করা
object.style.textIndent
textIndent পরিবর্তন করা
object.style.textIndent = "value"
মানগুলো
এখানে, value হতে পারে:
| মান | ব্যাখ্যা |
|---|---|
| inherit | এটি প্যারেন্ট এলিমেন্ট থেকে এই প্রোপার্টির মান ইনহেরিট করে। |
| initial | এটি এই প্রোপার্টির মান ডিফল্ট ভ্যালুতে সেট করে। |
| percentage(%) | এটি প্যারেন্ট এলিমেন্টের প্রস্থের শতাংশের মাধ্যমে মান সেট করে। |
| length | এটি দৈর্ঘ্য এককের মাধ্যমে মান সেট করে। |
উদাহরণ
Style textIndent প্রোপার্টির একটি উদাহরণ দেখি:
<!DOCTYPE html> <html> <head> <style> body { color: #000; background: lightblue; height: 100vh; } p { margin: 1.5rem auto; } .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 textIndent 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">Set textIndent</button> <script> function add() { document.querySelector('p').style.textIndent = "80px"; } </script> </body> </html>
আউটপুট
এটি নিচের আউটপুট তৈরি করবে:

Set textIndent বাটনে ক্লিক করুন প্যারাগ্রাফ টেক্সটের প্রথম লাইনের ইন্ডেন্টেশন পরিবর্তন করতে।
