TIL

20230427 TIL

๊น€๋นต๊ทธ 2023. 4. 27. 20:30

๐Ÿ˜Ž Today ์š”์•ฝ 

1. ์†Œ์ˆ˜ > ์ •์ˆ˜ round(๋ฐ˜์˜ฌ๋ฆผ), ceil(์˜ฌ๋ฆผ), floor(๋‚ด๋ฆผ)
2. js์—์„œ ํƒœ๊ทธ ์ถ”๊ฐ€์‹œ document.createElement(ํƒœ๊ทธ๋ช…)
3.

๐Ÿ‘ 1. ์ž˜ํ•œ ์ 

[โœ…] ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ๊ธฐ์ดˆ 3๋ฌธ์ œ

[โœ…] js ๋ณต์Šต 6.0-6.2

[โœ…] js ์ฑŒ๋ฆฐ์ง€ ์ œ์ถœ

โœŒ๏ธ 2. ๊ฐœ์„  ์ 

์ค‘์š”ํ•œ๊ฑด.. ์ง€์น˜์ง€ ์•Š๋Š” ๋งˆ์Œ.. ! ์ผ๋•Œ๋ฌธ์— ๋„ˆ๋ฌด ๋ฐ”๋น ์„œ ์‹œ๊ฐ„ ์—†์ง€๋งŒ ์กฐ๊ธˆ์ด๋ผ๋„ 10๋ถ„์ด๋ผ๋„ ํ•ด์•ผ์ง€!!

์ฑŒ๋ฆฐ์ง€ ๊ณต๋ถ€ ๊พธ์ค€ํžˆ ๊ฐ€๋ณด์ž๊ณ !!

 

๐Ÿ‘‹ 3. ๋ฐฐ์šด ์ 

1)  ์†Œ์ˆ˜๋ฅผ ์ •์ˆ˜๋กœ

 1. Math.round() ๋ฐ˜์˜ฌ๋ฆผ

Math.round(1.1) ///1
Math.round(1.7) ///2

2.Math.Ceil() ์˜ฌ๋ฆผ

Math.ceil(0.95) ///1
Math.ceil(7.002) /// 8

3.Math.floor() ๋‚ด๋ฆผ

Math.floor(5.95) /// 5
Math.floor(-5.05) /// -6

2) CSS background gradients 

.horizontal-gradient {
  background: linear-gradient(to right, blue, pink);
}

.simple-linear {
  background: linear-gradient(blue, pink);
}
 

Using CSS gradients - CSS: Cascading Style Sheets | MDN

CSS gradients are represented by the <gradient> data type, a special type of <image> made of a progressive transition between two or more colors. You can choose between three types of gradients: linear (created with the linear-gradient() function), radial

developer.mozilla.org

3) js์— style bg gradients ์ถ”๊ฐ€ํ•˜๊ธฐ

body.style.background = `linear-gradient(to right, red, blue)`;