<div class="mainimage">
<p class="mainimage-text">
<span>Beautiful sunset</span>
</p>
<p class="mainimage-sub-text">Nice gradient sky</p>
</div>
@import url('https://fonts.googleapis.com/css2?family=Caveat&family=Paytone+One&display=swap');
* {
margin: 0;
padding: 0;
line-height: 1;
box-sizing: border-box;
}
body {
background: #05243c;
height:100%;
}
.mainimage {
max-width: 600px;
min-height: 200px;
margin: 0 auto;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.mainimage-text {
margin: 0 auto;
text-align: center;
font-family: 'Paytone One', sans-serif;
font-size: 100px;
line-height: 1em;
color: transparent;
}
.mainimage span {
display: block;
max-width: 600px;
height: 200px;
background: url("https://picsum.photos/id/980/600/400") no-repeat center center;
-webkit-background-clip: text;
background-clip: text;
background-size: cover ;
}
.mainimage::before {
content: "";
display: block;
width: 60px;
height: 60px;
position: absolute;
top: -60px;
left: -100px;
border-style: solid;
border-width: 1px 0 0 1px;
border-color: rgba(255, 255, 255, 0.5);
}
.mainimage-text::after {
content: "";
display: block;
width: 60px;
height: 60px;
position: absolute;
bottom: -60px;
right: -100px;
border-style: solid;
border-width: 0 1px 1px 0;
border-color: rgba(255, 255, 255, 0.5);
}
.mainimage span::before {
content: "";
display: block;
width: 20px;
height: 20px;
position: absolute;
top: -80px;
left: -120px;
border-style: solid;
border-width: 0 1px 1px 0;
border-color: rgba(255, 255, 255, 0.5);
}
.mainimage span::after {
content: "";
display: block;
width: 20px;
height: 20px;
position: absolute;
bottom: -80px;
right: -120px;
border-style: solid;
border-width: 1px 0 0 1px;
border-color: rgba(255, 255, 255, 0.5);
}
.mainimage-sub-text {
display:block;
font-family: 'Caveat', cursive;
font-size: 75px;
line-height:1em;
color: rgba(255, 255, 255, 0.2);
position: absolute;
bottom: -25px;
right: -100px;
transform: rotate(-7deg);
z-index: -10;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.