๋ฐ์ํ
1. opacity ์์ฑ
div{
background-color : rgb(255,255,255); opacity : 0.5;
}
2. rgba ์์ฑ
div{
background-color : rgb(255,255,255,0.5);
}
div ํ๊ทธ์ ํฌ๋ช ๋๋ฅผ 0 ~ 1์ ๊ฐ์ผ๋ก ์ค์ ํ ์ ์๋ค. 0์ ๊ฐ๊น์ธ์๋ก ํฌ๋ช ํด์ง๋ค.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
<style>
body{
background-image: url(img/logo27.png);
}
div{
margin: 2rem;
width: 200px;
height: 200px;
border: 5px solid #decdad;
display: inline-block;
text-align: center;
font-size: 20px;
}
.test {background-color : rgb(255,255,255,0.1);}
.test2{background-color : rgb(255,255,255,0.2);}
.test3{background-color : rgb(255,255,255,0.4);}
.test4{background-color : rgb(255,255,255,0.6);}
.test5{background-color : rgb(255,255,255,0.8);}
.test6{background-color : rgb(255,255,255,1);}
</style>
</head>
<body>
<div class = "test">0.1</div>
<div class = "test2">0.2</div>
<div class = "test3">0.4</div><br>
<div class = "test4">0.6</div>
<div class = "test5">0.8</div>
<div class = "test6">1</div>
</body>
</html>
300x250
'๊ฐ๋ฐ์ธ์ด > JS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[JS] replace, replaceAll ์ฌ์ฉ๋ฐฉ๋ฒ (0) | 2022.05.03 |
---|---|
[CSS] ์ด๋ฏธ์ง์ ์ ์ฉํ ๋ง์ฐ์ค hover ํจ๊ณผ๋ค (์์ํฌํจ) (1) | 2022.04.17 |
[CSS] background-repeat (๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง ๋ฐ๋ณต ์ฌ๋ถ) (0) | 2022.04.09 |
[CSS] ์ปฌ๋ฌ ์ฐจํธ ๋ฆฌ์คํธ (0) | 2022.04.08 |
[CSS] background-size (๋ฐฐ๊ฒฝ์ด๋ฏธ์ง ํฌ๊ธฐ) (0) | 2022.04.08 |