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 สามารถระบุได้โดยวิธีการดังต่อไปนี้:

  • สีเลขฐานสิบหก
  • สี RGB
  • สี RGBA
  • สี HSL
  • สี HSLA
  • ที่กำหนดไว้ล่วงหน้า / ชื่อสีเบราว์เซอร์

สีเลขฐานสิบหก

เบราว์เซอร์ที่สำคัญทุกการสนับสนุนค่าสีฐานสิบหก

ระบุสีฐานสิบหกของส่วนประกอบที่: # RRGGBB ที่ RR (สีแดง), GG (สีเขียว) และบีบี (สีฟ้า) ค่าทั้งหมดจะต้องอยู่ระหว่าง 0 และ FF

<p ตัวอย่างเช่นค่า # 0000FF จะกลายเป็นสีฟ้า, สีฟ้าเป็นค่าสูงสุดขององค์ประกอบ (FF) และอื่น ๆ ตั้งค่าเป็นศูนย์

ตัวอย่าง

p
{
background-color:#ff0000;
}

ลอง»


สี RGB

ค่าสี RGB ได้รับการสนับสนุนในเบราว์เซอร์ที่สำคัญทั้งหมด

ค่าสี RGB ระบุ: RGB (สีแดง, สีเขียว, สีฟ้า) ความสว่างของแต่ละพารามิเตอร์ (สีแดง, สีเขียวและสีฟ้า) คำจำกัดความของสีที่สามารถเป็นจำนวนเต็มระหว่าง 0 และ 255 หรือค่าเปอร์เซ็นต์และระหว่าง (จาก 0% ถึง 100%)

เช่น RGB (0,0,255) ค่าการแสดงผลเป็นสีฟ้าเพราะสีฟ้าพารามิเตอร์ที่ถูกกำหนดเป็นค่าสูงสุด (255) ในขณะที่คนอื่น ๆ มีค่าเป็น 0

นอกจากนี้ค่าต่อไปนี้ที่มีสีเดียวกันจะมีการกำหนด: rgb (0,0,255) RGB (0%, 0%, 100%)

ตัวอย่าง

p
{
background-color:rgb(255,0,0);
}

ลอง»


สี RGBA

ค่าสี RGBA มี IE9, Firefox3 +, Chrome, Safari และการสนับสนุน Opera10 +

ค่าสี RGBA เป็นค่าสี RGB ขยายช่องอัลฟา - ความโปร่งใสวัตถุที่ระบุ

RGBA ค่าสีระบุ RGBA (สีแดง, สีเขียว, สีฟ้า, อัลฟา) พารามิเตอร์อัลฟาเป็นตัวเลขระหว่าง 0.0 (โปร่งใสเต็มที่) และ 1.0 (ทึบแสงเต็มที่) พารามิเตอร์

ตัวอย่าง

p
{
background-color:rgba(255,0,0,0.5);
}

ลอง»


สี HSL

IE9, Firefox, Chrome, Safari และ Opera 10+. สนับสนุนค่าสี HSL

ตัวแทน HSL ของสี, ความอิ่มตัวและความสว่าง - ใช้พิกัดทรงกระบอกสี

ค่าสี HSL ระบุ HSL (สี, ความเข้มความสว่าง)

เว้เป็นระดับบนวงล้อสี (0-360) -0 (หรือ 360) เป็นสีแดง, สีเขียว 120, 240 สีฟ้า อิ่มตัวเป็นร้อยละ; 0% และ 100% ของเงาสีเทาหมายถึงสีเต็มรูปแบบ ความสว่างยังเป็นเปอร์เซ็นต์; 0% เป็นสีดำ 100% เป็นสีขาว

ตัวอย่าง

p
{
background-color:hsl(120,65%,75%);
}

ลอง»


สี HSLA

ค่าสี HSLA มี IE9, Firefox3 +, Chrome, Safari และ Opera10 +. สนับสนุน

ค่าสี HSLA เป็นส่วนขยายของค่าสี HSL กับช่องอัลฟา - ความโปร่งใสของวัตถุที่ระบุ

ระบุค่าสี HSLA: HSLA (สี, ความเข้มความสว่างα) αคือนิยามความทึบพารามิเตอร์อัลฟา พารามิเตอร์อัลฟาเป็นตัวเลขระหว่าง 0.0 (โปร่งใสเต็มที่) และ 1.0 (ทึบแสงเต็มที่) พารามิเตอร์

ตัวอย่าง

p
{
background-color:hsla(120,65%,75%,0.3);
}

ลอง»


ที่กำหนดไว้ล่วงหน้า / ชื่อสีเบราว์เซอร์

147 อยู่ใน HTML และ CSS การกำหนดสีชื่อสีที่กำหนดไว้ล่วงหน้า คุณสามารถมองเห็นของเรา ชื่อตารางสีที่กำหนดไว้ล่วงหน้า