css
ใช้สำหรับจัดและตกแต่งหน้าเว็บ
สร้างไฟล์ css
สร้างไฟล์ css ชื่อ style ไว้ที่ accounts/static/accounts/ และแก้ไขดังนี้
body {
background : #aed6f1;
text-align: center;
}
table, th, td {
font-size : 20px;
border : 1px solid black;
border-collapse : collapse;
padding : 5px;
text-align : left;
margin : auto;
}
table th {
background-color : #000000;
color : #ffffff;
text-align : center;
}
แต่ละส่วนจะกำหนดรูปแบบของ tag ต่างๆ ในที่นี่กำหนดส่วนของ body table th td
เรียกใช้ไฟล์ css
ทำการโหลดไฟล์ css ที่ไฟล์ template index และ detail ดังนี้
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'accounts/style.css' %}"/>
ไม่มีความคิดเห็น:
แสดงความคิดเห็น