CSS text-align প্রপার্টি ব্যবহার করে আমরা একটি উপাদানের টেক্সট অনুভূমিকভাবে সেট করতে পারি। আমরা এটিকে বাম, ডান, ন্যায্যতা বা কেন্দ্রে সেট করতে পারি।
সিনট্যাক্স
CSS টেক্সট-সারিবদ্ধ বৈশিষ্ট্যের সিনট্যাক্স নিম্নরূপ -
Selector {
text-align: /*value*/
} উদাহরণ
নিম্নলিখিত উদাহরণগুলি CSS টেক্সট-সারিবদ্ধ বৈশিষ্ট্য −
চিত্রিত করে<!DOCTYPE html>
<html>
<head>
<style>
div {
margin: auto;
padding: 8px;
max-width: 200px;
border: thin solid;
}
p {
text-align: right;
}
div:nth-child(3) {
text-align: center;
}
div:last-child {
text-align: justify;
}
</style>
</head>
<body>
<h2>Student Examination Details</h2>
<div>
<div>Student John</div>
<div>
Student Tom
<p>Did not appeared for the exams.</p>
</div>
<div>Student Brad</div>
<div>Did not appeared for only the last exam.</div>
</div>
</body>
</html> আউটপুট
এটি নিম্নলিখিত আউটপুট দেয় -

উদাহরণ
<!DOCTYPE html>
<html>
<head>
<style>
td {
padding: 10px;
box-shadow: inset 0 0 21px yellow;
}
td:first-of-type {
text-align: right;
}
</style>
</head>
<body>
<h2>Demo Heading</h2>
<table>
<tr>
<td>This is it!</td>
</tr>
<tr>
<td>Well, this is a demo text!</td>
</tr>
</table>
</body>
</html> আউটপুট
এটি নিম্নলিখিত আউটপুট দেয় -
