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

CSS overflow: scroll


แสดง scrollbar ตลอดเวลา

overflow: scroll ตัดเนื้อหาที่ล้นและแสดง scrollbar ทั้งแนวนอนและแนวตั้งตลอดเวลา

ตัวอย่าง

<!DOCTYPE html>
<html>
<head>
  <style>
    div {
      background-color: orange;
      width: 250px;
      height: 45px;
      border: 2px solid blue;
      overflow: scroll;
    }
  </style>
</head>
<body>
  <h1>Heading</h1>
  <div>Overflow property used here...</div>
</body>
</html>