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

แอตทริบิวต์ rows ใน HTML

แอตทริบิวต์ rows ใน HTML ใช้กำหนดความสูงที่มองเห็นได้ขององค์ประกอบ textarea ในเอกสาร HTML

ไวยากรณ์

<textarea rows="number"></textarea>

ตัวอย่าง

<!DOCTYPE html>
<html>
<style>
  body {
    color: #000;
    height: 100vh;
    background-color: #8BC6EC;
    background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%);
    text-align: center;
  }
</style>
<body>
<h1>ตัวอย่าง HTML rows</h1>
<textarea rows="10" cols="20">สวัสดี! ฉันคือองค์ประกอบ textarea พร้อมข้อความตัวอย่าง.</textarea>
</body>
</html>

ผลลัพธ์

แสดง textarea ที่มีความสูง 10 แถว และความกว้าง 20 คอลัมน์