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

วิธีเพิ่มส่วน noframe ใน HTML

ใช้แท็ก <noframes> เพื่อเพิ่มส่วน noframe แท็ก HTML <noframes> ใช้จัดการเบราว์เซอร์ที่ไม่รองรับแท็ก <frame> ใช้แสดงข้อความทางเลือก

ตัวอย่าง

<!DOCTYPE html> 
<html> 
  <head> 
    <title>HTML noframes Tag</title> 
  </head> 
  <frameset cols="200, *"> 
    <frame src="/html/menu.htm" name="menu_page" /> 
    <frame src="/html/main.htm" name="main_page" /> 
    <noframes> 
      <body> 
        เบราว์เซอร์ของคุณไม่รองรับเฟรม 
      </body> 
    </noframes> 
  </frameset> 
</html>

สถานะปัจจุบัน: แท็ก <frameset>, <frame>, <noframes> ล้าสมัยและถูกลบออกจาก HTML5 แล้ว

ตัวเลือกแทนที่สมัยใหม่:

  • <iframe> - สำหรับฝังหน้าอื่น
  • CSS Layout (Flexbox, Grid) - สำหรับเลย์เอาต์หลายคอลัมน์
  • Server-side includes หรือ JavaScript (fetch/AJAX) - สำหรับรวมเนื้อหา