3D Text Bubble
Home
Snippets
3D Text Bubble
HTML
CSS
JS
<div class="bubbleTxt"> <h1>Bubble Text</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa cupiditate rerum perferendis dolore quos tempora soluta provident ex.</p> </div>
.bubbleTxt { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotateY(40deg); width: 300px; height: 300px; background-color: #ffffff4d; transform-style: preserve-3d; perspective: 1200px; transition: 0.3s; display: flex; flex-direction: column; justify-content: center; } .bubbleTxt h1 { font-size: 2.2em; font-weight: bold; letter-spacing: -0.05em; text-transform: uppercase; margin: 0.5em; } .bubbleTxt p { margin: 1.3em; line-height: 120%; } .bubbleTxt::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 30px 0 30px 37.5px; border-color: transparent transparent transparent #ffffff4d; position: absolute; right: -37px; top: 120px; transition: 0.3s; } .bubbleTxt::after { content: ""; position: absolute; left: -30px; top: 0; width: 30px; height: 300px; background-color: #ffffff80; transform-origin: right center; transform: rotateY(-90deg); } .bubbleTxt:hover { transform: translate(-50%, -50%) rotateY(0); background-color: #ffffff; } .bubbleTxt:hover::before { border-color: transparent transparent transparent #ffffff; } html, body { height: 100%; margin: 0; } body { background: linear-gradient( red, black); background-size: cover; font-family: "Droid Sans", sans-serif; perspective: 1200px; } body::before { content: ""; position: absolute; width: 100%; height: 100%; background-color: #00000099; }
//javascript
Ad #1
Ad #2
Scroll to Top