Instagram Logo Using HTML & CSS

5 min read
Instagram Logo Demo

Project Overview

This project focuses on recreating the iconic Instagram logo purely with HTML and CSS. It demonstrates how to use fundamental CSS properties like `border-radius`, `background-image` with gradients, `box-shadow`, and pseudo-elements (`::before`, `::after`) to construct complex shapes and visual effects without relying on image assets. The logo is fully responsive and scalable, making it a great example for understanding advanced CSS drawing techniques.

Key features include the main square shape with rounded corners, the inner square with a white border, the central circle, and the small white dot in the top-right corner, all meticulously crafted using CSS. The vibrant gradient background, characteristic of the Instagram logo, is achieved using a radial gradient. This project is an excellent exercise in mastering CSS for intricate graphic design, showcasing the power and flexibility of styling without external images or JavaScript.

HTML Structure

The HTML structure for the Instagram Logo is incredibly simple, consisting of just two nested `div` elements. The outer `div` with the class `insta` serves as the main container for the logo, defining its overall size and primary background. Inside this, an `innerbox` `div` is nested. This `innerbox` is crucial as it will be styled with CSS to create the inner square and, through its pseudo-elements (`::before` and `::after`), will form the central circle and the small dot. This minimalist HTML approach highlights how much visual complexity can be achieved purely through CSS styling.


<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>INSTA LOGO HTML CSS</title>
  <link rel="stylesheet" href="style.css">

</head>
<body>
<!-- partial:index.partial.html -->
<div class="insta">
  <div class="innerbox">
  </div>
</div>
<!-- partial -->

</body>
</html>
                        

CSS Styling

The CSS for the Instagram Logo is where all the magic happens. It meticulously crafts the logo's appearance using a combination of `border-radius`, `background` gradients, and pseudo-elements. The `body` styles ensure the logo is centered on the page. The `.insta` class defines the main outer square with its characteristic rounded corners and the vibrant radial gradient background. The `.innerbox` class creates the inner square with a white border and rounded corners. Crucially, the `::before` pseudo-element of `.innerbox` is used to create the central circle with a white border, and the `::after` pseudo-element creates the small white dot in the top-right corner. Positioning properties like `position: absolute`, `top`, and `right` are used to precisely place these elements. This intricate CSS demonstrates powerful techniques for drawing complex shapes and achieving detailed visual designs without relying on images.


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.insta {
  width: 150px;
  height: 150px;
  background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285aeb 90%
  );
  border-radius: 35px;
  display: grid;
  place-items: center;
}

.innerbox {
  width: 120px;
  height: 120px;
  border: 10px solid #fff;
  border-radius: 32px;
  display: grid;
  place-items: center;
  position: relative;
}

 .innerbox::before {
  content: "";
  width: 45px;
  height: 45px;
  border: 10px solid #fff;
  border-radius: 50%;
  background: transparent;
  position: absolute;
}

.innerbox::after {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 8px;
  right: 10px;
} 
                        

Live Demo: Instagram Logo

Watch a live demonstration of the Instagram Logo below.

Final Thoughts

This Instagram Logo project serves as an excellent demonstration of how powerful CSS can be for creating complex graphics. By leveraging basic shapes, borders, and gradients, you can achieve highly detailed and visually accurate designs without the need for external image files or JavaScript. This approach results in lightweight, scalable, and easily modifiable assets.

You can easily customize this component by:

  • Experimenting with different color gradients for the background.
  • Adjusting the `border-radius` values to change the roundness of the corners.
  • Modifying the sizes and positions of the inner elements to create variations of the logo.
  • Adding subtle animations or transitions on hover for interactive effects.

Pro Tip

When creating complex shapes with CSS, break down the logo into its simplest geometric components. Then, use pseudo-elements (`::before` and `::after`) to add additional layers and details, carefully managing their positioning with `absolute` or `relative` positioning.

Ready to Use This Project?

Click the button below to download the full source code. Download will be ready in 10 seconds.

Stay Updated

Receive coding tips and resources updates. No spam.

We respect your privacy. Unsubscribe at any time.