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

วิธีทำให้เนื้อหาหลักเติมความสูงของหน้าจอด้วย CSS และ HTML


ตำแหน่ง ตำแหน่ง คุณสมบัติระบุประเภทของวิธีการกำหนดตำแหน่งที่ใช้สำหรับองค์ประกอบ (คงที่, สัมพันธ์, สัมบูรณ์, คงที่หรือเหนียว)

ในตัวอย่างด้านล่าง ไม่ได้ระบุความสูงเป็นเปอร์เซ็นต์และไม่ต้องการ jQuery

.mainbody{  
   position: absolute;//here we are setting the position of an element as absolute
   top: 30px; /* here we are defining Header Height to 30 px */
   bottom: 10px; /*here we are defining  Footer Height to 10 px */
   width: 100%;// here we are setting the width to 100%
}