Latest web development tutorials
×

CSS คู่มืออ้างอิง

CSS คู่มืออ้างอิง CSS ผู้เลือก CSS อ้างอิงคำพูด CSS Web แบบอักษรปลอดภัย CSS นิเมชั่น CSS หน่วย CSS สี CSS ค่าสีตามกฎหมาย CSS ชื่อสี CSS ค่าสีฐานสิบหก CSS สนับสนุนเบราว์เซอร์

CSS คุณสมบัติ

align-content align-items align-self all animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-align box-direction box-flex box-flex-group box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing caption-side clear clip color column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset cursor direction display empty-cells filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font @font-face font-family font-size font-size-adjust font-stretch font-style font-variant font-weight grid-columns grid-rows hanging-punctuation height icon justify-content @keyframes left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top max-height max-width @media min-height min-width nav-down nav-index nav-left nav-right nav-up opacity order outline outline-color outline-offset outline-style outline-width overflow overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page-break-after page-break-before page-break-inside perspective perspective-origin position punctuation-trim quotes resize right rotation tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-style text-indent text-justify text-outline text-overflow text-shadow text-transform text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility white-space width word-break word-spacing word-wrap z-index

หน่วย CSS

CSS มีหน่วยที่แตกต่างกันมาใช้เพื่อเป็นตัวแทนของความยาว

โรงแรมบางแห่งมีการตั้งค่า CSS ความยาวความกว้างขอบ padding, font-size ชายแดนที่มีความกว้างและอื่น ๆ

ความยาวและหน่วยดิจิตอลเช่น 10px คือ 2em และอื่น ๆ

ไม่สามารถมีช่องว่างระหว่างตัวเลขและหน่วย ถ้าความยาวเป็น 0 หน่วยสามารถละเว้น

สำหรับคุณสมบัติบาง CSS, ความยาวสามารถเป็นค่าลบ

มีสองประเภทของหน่วยความยาว: ญาติและ Absolute


สนับสนุนเบราว์เซอร์

ตารางต่อไปนี้แสดงให้เห็นรุ่นเบราว์เซอร์ขั้นต่ำที่สนับสนุนหน่วยของความยาว

หน่วยของความยาว
em, อดีต% PX, ซม., มมใน PT, PC 1.0 3.0 1.0 1.0 3.5
CH 27.0 9.0 1.0 7.0 20.0
REM 4.0 9.0 3.6 4.1 11.6
VH, VW 20.0 9.0 19.0 6.0 20.0
vmin 20.0 9.0 * 19.0 6.0 20.0
VMax 26.0 ไม่สนับสนุน 19.0 ไม่สนับสนุน 20.0

หมายเหตุ: Internet Explorer 9 โดยที่ไม่ได้มาตรฐานชื่อ VM สนับสนุน vmin


ความยาวของญาติ

หน่วยความยาวญาติระบุความยาวเมื่อเทียบกับความยาวของทรัพย์สินของผู้อื่น ทั้งนี้ขึ้นอยู่กับอุปกรณ์ความยาวที่เหมาะสมกว่า

หน่วย ลักษณะ ตัวอย่างออนไลน์
em มันอธิบายเกี่ยวกับการประยุกต์ใช้ขนาดตัวอักษรขององค์ประกอบปัจจุบันก็ยังเป็นหน่วยความยาวญาติ โดยปกติเบราว์เซอร์ขนาดตัวอักษรเริ่มต้นคือ 16px แล้ว 2em == 32px; ความพยายาม
อดีต ภาพภาษาอังกฤษขึ้นอยู่กับความสูงของ X ขนาดเล็ก ความพยายาม
CH ความกว้างของจำนวน 0
REM องค์ประกอบราก (HTML) แบบอักษรขนาด
VW ความกว้างของมุมมอง, ความกว้างของหน้าต่าง 1vw = 1% ของความกว้างของหน้าต่าง ความพยายาม
VH มุมมองความสูงความสูงหน้าต่าง 1vh = ความสูงหน้าต่าง 1% ความพยายาม
vmin VW และเป็นหนึ่ง VH ขนาดเล็ก ความพยายาม
VMax VW และเป็นหนึ่ง VH ขนาดใหญ่ ความพยายาม
%

หมายเหตุเคล็ดลับ: em REMและสิ่งที่แตกต่างกันไม่ได้หรือไม่ ยกเว้นว่า REM องค์ประกอบที่กำหนดขนาดตัวอักษรยังค่อนข้างขนาด แต่เพียงองค์ประกอบราก HTML ตรงข้าม

ความยาวของแอบโซลูท

หน่วยความยาวแอบโซลูทเป็นค่าคงที่มันสะท้อนให้เห็นขนาดทางกายภาพจริง หน่วยความยาวของ Absolute สูงขึ้นอยู่กับขนาดกลางที่ส่งออกก็ไม่ได้ขึ้นอยู่กับสภาพแวดล้อม (จอแสดงผลความละเอียดระบบปฏิบัติการอื่น ๆ )

หน่วย ลักษณะ ตัวอย่างออนไลน์
ซม. ซม. ความพยายาม
มิลลิเมตร มิลลิเมตร ความพยายาม
ใน นิ้ว (1in = 96 พิกเซล = 2.54cm) ความพยายาม
px * พิกเซล (1px = 1/96 1in) ความพยายาม
จุด จุดประมาณ 1/72 ของนิ้ว (1pt = 1 / 72in) ความพยายาม
พีซี Pica ประมาณ 6PT 1/6 Yingcun (1pc = 12 pt) ความพยายาม

บางทีพิกเซลถือว่าเป็นสิ่งที่ดีที่สุด "พิกเซลอุปกรณ์" และระยะเวลาในพิกเซลนี้และคุณจะเห็นข้อความบนพิกเซลหน้าจอแสดงผลที่ไม่เกี่ยวข้อง px เป็นจริงตัวชี้วัดของหน่วยมุม