วันพุธที่ 17 ตุลาคม พ.ศ. 2555

ความรู้/note เรื่อง HTML/CSS

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 จะให้แสดงผลอย่างไร

ValueDescriptionPlay it
visibleThe overflow is not clipped. It renders outside the element's box. This is defaultPlay it »
hiddenThe overflow is clipped, and the rest of the content will be invisiblePlay it »
scrollThe overflow is clipped, but a scroll-bar is added to see the rest of the contentPlay it »
autoIf overflow is clipped, a scroll-bar should be added to see the rest of the contentPlay it »
inheritSpecifies that the value of the overflow property should be inherited from the parent element


CSS - float Property

คุณสมบัตินี้ กำหนดว่า box of element ควรจะลอยหรือไม่

ValueDescriptionPlay it
leftThe element floats to the leftPlay it »
rightThe element floats the rightPlay it »
noneThe element is not floated, and will be displayed just where it occurs in the text. This is defaultPlay it »
inheritSpecifies 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 จุดบนหน้าจอ


ไม่มีความคิดเห็น:

แสดงความคิดเห็น