Skip to content
Related Articles
Open in App
Not now

Related Articles

How to create Perspective Text using HTML & CSS ?

Improve Article
Save Article
Like Article
  • Last Updated : 14 Apr, 2021
Improve Article
Save Article
Like Article

In this article, we are going to create an illusion of images below the main image. This is a simple article, we can achieve our target only by using HTML & CSS.

Approach: Create a main div in which we have added a heading tag and then use the selectors in CSS to create the effects.

HTML Code:

  1. First, we create an HTML file(index.html).
  2. After creating the HTML file, we are going to give title to our webpage using <title> tag. It should be placed inside the <head> tag.
  3. Then we link the CSS file that provides all the animations effect to our html. It is also placed inside <head> tag.
  4. Coming to the body section of our HTML code.
    1. Firstly, we are giving heading to our page.
    2. Inside the heading create 3 span to store the data.


<!DOCTYPE html>
<html lang="en">
    <link rel="stylesheet" href="style.css">

CSS Code: CSS is used to give different types of animations and effect to our HTML page so that it looks interactive to all users. In CSS, we have to remember the following points-

  • Restore all the browser effects.
  • Use classes and ids to give effects to HTML elements.
  • Use of selectors to select different elements!


    margin: 0;
    padding: 0;
    box-sizing: border-box;
    height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    color: teal;
    width: 3em;
    height: 1em;
    font-size: 6em;
    position: relative;
    white-space: nowrap;
    color: transparent;
h1 span{
    position: absolute;
    background-color: rgb(7, 138, 138);
    color: #000;
    transform: skew(50deg,-20deg) scaleY(0.75);
    transform: skew(-5deg,-20deg);
    bottom: 1em;
    left: 0.5em;
    top: 0.5em;
    left: 2em;
    top: 2em;
    left: 2.5em;


My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!