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

วิธีเปลี่ยน Font ตัวอักษรใน HTML

ใช้ Attribute style ร่วมกับ CSS Property font-family, font-size, font-style HTML5 ไม่รองรับ Tag <font> แล้ว (Deprecated)

โปรดทราบ: Style Attribute จะทับทับ Global Styles รวมถึงใน <style> หรือ External Stylesheet

วิธีเปลี่ยน Font ตัวอักษรใน HTML

ตัวอย่าง

<!DOCTYPE html> <html> 
  <head> 
    <title>HTML Font</title> 
  </head> 
  <body> 
    <h1>Our Products</h1> 
    <p style="font-family:georgia,garamond,serif;font-size:16px;font-style:italic;"> 
      This is demo text 
    </p> 
  </body> 
</html>