๐Ÿ’งCSS:Others Properties

hojuneยท2023๋…„ 8์›” 13์ผ
0

Web Development

๋ชฉ๋ก ๋ณด๊ธฐ
8/33

Rgba

ํˆฌ๋ช…๋„๊นŒ์ง€ ํฌํ•จ๋œ Rgb

rgba-  ( , , , alpha channel)



alpha = 0 ํˆฌ๋ช…

alpha = 1 ๋ถˆํˆฌ๋ช…

hex = ff ๋ถˆํˆฌ๋ช…

Opacity

์ „์ฒด ์š”์†Œ์˜ ํˆฌ๋ช…๋„ ๊ด€์—ฌ

Position property

static - ์ผ๋ฐ˜์  ๋ฌธ์„œ ํ๋ฆ„์— ๋”ฐ๋ผ ๋ฐฐ์น˜ top left px์„ค์ •๊ณผ ๊ฐ™์€ ์š”์†Œ์— ์ ์šฉ์„ ๋ฐ›์ง€ ์•Š์Œ

relative - ์š”์†Œ๋ฅผ ์ผ๋ฐ˜์  ๋ฌธ์„œ ํ๋ฆ„์— ๋”ฐ๋ผ ๋ฐฐ์น˜ ์œ„์™€ ๊ฐ™์€ ์š”์†Œ์— ๋Œ€ํ•œ ์ ์šฉ์„ ๋ฐ›์Œ

absolute - ๊ณต๊ฐ„ ๋ฐฐ์ • x ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ์œ„์น˜์˜ ์ง€์ • ์กฐ์ƒ ์š”์†Œ์— ๋Œ€ํ•ด ์ƒ๋Œ€์  ๋ฐฐ์น˜ ๋‹จ ์—†๋‹ค๋ฉด 
์ดˆ๊ธฐ ์ปจํ…Œ์ด๋‹ ๋ธ”๋ก์„ ๊ธฐ์ค€ ์‚ผ์Œ

fixed - ๊ณต๊ฐ„ ๋ฐฐ์ • x 

sticky 

top,left๊ฐ™์€ ์š”์†Œ๋ฅผ ์ด์šฉํ•ด์„œ ๊ณต๊ฐ„์„ ๋ฒŒ๋ฆด์ˆ˜ ์žˆ์Œ ์œ„๋กœ๋ถ€ํ„ฐ ๋ช‡ px ์ด๋Ÿฐ์‹

Transitions

property name

duration

timing function


delay
.circle {
    width: 300px;
    
    height: 300px;
    
    background-color: magenta;
    
    transition: background-color 1s,ease-in,border-radius 2s;
}

.circle:hover {

    background-color: cyan;

    border-radius: 50%;

}

section div {

    height: 100px;

    width: 100px;

    background-color: black;

    margin: 20px 20px;

    transition: margin-left 3s;

}


section:hover div {

    margin-left: 500px;

}


div:nth-of-type(1) {

    transition-timing-function: ease-in;

}


div:nth-of-type(2) {

    transition-timing-function: ease-out;

}


div:nth-of-type(3) {

    transition-timing-function: cubic-bezier(0.7, 0, 0.84, 0);

}


div:nth-of-type(4) {

    transition-timing-function: ease-in;

}


transition ์ง€์ •ํ• ๋•Œ all์š”์†Œ๋„ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•˜์ง€๋งŒ ๊ฐœ๋ณ„ ์š”์†Œ๋กœ ์ง€์ •ํ•˜๋Š” ๊ฒƒ์„ ์ง€ํ–ฅ

๋‚˜์ค‘์— ์ˆ˜์ •ํ•  ๋•Œ ์šฉ์ดํ•จ

Transform

transform : skew(30deg)  scale(1.3)

์ด๋Ÿฐ์‹์œผ๋กœ ์‚ฌ์šฉ๊ฐ€๋Šฅ 

์—ฌ๋Ÿฌ ์˜ต์…˜์ด ์žˆ์Œ

Button Hover Effect

effect๋ฅผ ์–ด๋–ค ์š”์†Œ๋“ค์„ ์ด์šฉํ•ด์„œ ๋งŒ๋“œ๋Š” ์ง€ 


body {

  font-family: 'Roboto', sans-serif;

  display: flex;

  align-items: center;

  justify-content: center;

  height: 100vh;

  background-color: #151b29;

}

button {

  background: none;

  color: #ffa260;

  border: 2px soild;

  padding: 1.5em 2em;

  font-size: 1em;

  transition: 1s;

}

button:hover {

  border-color: #f1ff5c;

  color: white;

  box-shadow: 0 0.5em 0.5em -0.4em yellowgreen;

  transform: translateY(-0.25em);

}

Background

color, img, size, etc.

no repeat - ์ด๋ฏธ์ง€ ๋ฐ˜๋ณต ๋ง‰์„ ์ˆ˜ ์žˆ์Œ

 background-image: url("https://images.unsplash.com/photo-1564442038901-4f9a19d3d456?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1227&q=80");

 background-size: cover;

 background-position: top;

 margin: 0 auto;

์†๊ธฐ

 background: center/cover url("https://images.unsplash.com/photo-1564442038901-4f9a19d3d456?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1227&q=80");

Google Fonts

๋ณดํ†ต pairing ๊ธ€๊ผด์ด ์žˆ์Œ

๋จธ๋ฆฟ๋ง - ๋ณธ๋ฌธ

0๊ฐœ์˜ ๋Œ“๊ธ€