การใช้งาน CSS ทำได้ 3 วิธี
1.แบบ Inline
<!DOCTYPE html>
<html>
<head>
<title>BOOTSTRAP4 workshop</title>
</head>
<body>
<h1 style="color:blue">Hello world</h1>
</body>
</html>
2.อยู่ใน style tag
<!DOCTYPE html>
<html>
<head>
<title>BOOTSTRAP4 workshop</title>
<style type="text/css">
h1 {
color: blue
}
</style>
</head>
<body>
<h1>Hello world</h1>
</body>
</html>
3.อยู่ในไฟล์ css
สร้างโฟลเดอร์ชื่อ css และสร้างไฟล์ชื่อ style.css
style.css
h1 {
color: blue
}
index.html
<!DOCTYPE html>
<html>
<head>
<title>BOOTSTRAP4 workshop</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<h1>Hello world</h1>
</body>
</html>
ไม่แนะนำให้ทำ 2 วิธีแรกสำหรับเว็บที่ใช้งานจริงๆ