Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS3를 사용하여 투명 상자의 텍스트

<시간/>

CSS3를 사용하여 투명 상자에 텍스트를 설정하려면 코드는 다음과 같습니다. -

예시

<!DOCTYPE html>
<html>
<head>
<style>
body {
   font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.transparentBox {
   background: url("https://i.picsum.photos/id/249/1000/300.jpg") repeat;
   border: 2px solid black;
}
.transparentText {
   margin: 30px;
   background-color: #ffffff;
   border: 1px solid black;
   opacity: 0.6;
}
.transparentText p {
   margin: 5%;
   font-weight: bolder;
   color: #000000;
   font-size: 20px;
}
</style>
</head>
<body>
<h1>Text in transparent box example</h1>
<div class="transparentBox">
<div class="transparentText">
<p>This is some random text inside the transparent box</p>
</div>
</div>
</body>
</html>

출력

위의 코드는 다음과 같은 출력을 생성합니다 -

CSS3를 사용하여 투명 상자의 텍스트