Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

จัดตำแหน่งบรรทัดสุดท้ายของข้อความด้วย CSS text-align-last


คุณสมบัติ text-align-last ใช้จัดตำแหน่งบรรทัดสุดท้ายของข้อความ ลองรันโค้ดด้านล่างเพื่อจัดตำแหน่งบรรทัดสุดท้ายด้วย CSS:

ตัวอย่าง

<!DOCTYPE html>
<html>
  <head>
    <style>
      .mydiv {
        text-align-last: right;
      }
    </style>
  </head>
  <body>
    <h1>text-align-last Property</h1>
    <div class="mydiv">
      <p>This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text.</p>
    </div>
  </body>
</html>

ผลลัพธ์

จัดตำแหน่งบรรทัดสุดท้ายของข้อความด้วย CSS text-align-last