POST vs GET ของ Form submission
POST is more secure - Cannot call an action via URL modification.
Using GET, users can modified the URL to call an actions.
Margin vs Padding
สรุปแบบง่ายๆ คือ Margin คือ ระยะห่างระหว่าง element border ของแต่ละ elementส่วน Padding คือ ระยะห่างระหว่าง content กับ border ของ element หนึ่งๆ
link1
link2
"Margin is on the outside of block elements while padding is on the inside.
use margin to separate the block from things outside it, padding to move the contents away from the edges of the block." from stackoverflow
CSS - Margin Property เซตได้กี่แบบ
Examples:
- margin:10px 5px 15px 20px;
- top margin is 10px
- right margin is 5px
- bottom margin is 15px
- left margin is 20px
- margin:10px 5px 15px;
- top margin is 10px
- right and left margins are 5px
- bottom margin is 15px
- margin:10px 5px;
- top and bottom margins are 10px
- right and left margins are 5px
- margin:10px;
- all four margins are 10px
Note: Negative values are allowed. And default value is 0.
CSS - Overflow Property
Overflow ใช้กำหนดว่า เมื่อ content ล้นออกมาจาก element box จะให้แสดงผลอย่างไร
Value | Description | Play it |
---|---|---|
visible | The overflow is not clipped. It renders outside the element's box. This is default | Play it » |
hidden | The overflow is clipped, and the rest of the content will be invisible | Play it » |
scroll | The overflow is clipped, but a scroll-bar is added to see the rest of the content | Play it » |
auto | If overflow is clipped, a scroll-bar should be added to see the rest of the content | Play it » |
inherit | Specifies that the value of the overflow property should be inherited from the parent element |
CSS - float Property
คุณสมบัตินี้ กำหนดว่า box of element ควรจะลอยหรือไม่
http://www.w3schools.com/cssref/pr_class_float.asp
Value | Description | Play it |
---|---|---|
left | The element floats to the left | Play it » |
right | The element floats the right | Play it » |
none | The element is not floated, and will be displayed just where it occurs in the text. This is default | Play it » |
inherit | Specifies that the value of the float property should be inherited from the parent element |
http://www.w3schools.com/cssref/pr_class_float.asp
CSS - em vs px
หน่วย em แปรผันตามขนาดของ font-size เช่น ถ้า font-size คือ 12, 1 em คือ 12 ด้วย มักใช้เพื่อ mobile-device-friendly
หน่วย px ไม่เป็นแบบ scalable แต่เป็น fixed-size. 1 px คือ 1 จุดบนหน้าจอ