Create a twitter-style profile header

Whether you've run out of inspiration or you're trying to recreate a website like twitter, this article will help you create a profile inspired by those offered by twitter.
•
Updated on August 14, 2026
•
3 min read
Believemy logo

Whether you're lacking inspiration or trying to recreate a website like Twitter, this article will allow you to reproduce a profile highly inspired by those offered by Twitter.

You can find the entire tutorial on our Instagram account

 

Step 1

Let's start by creating the structure of the header.

HTML
<div class="container">
      <div class="informations-bar">
        <ul>
          <li class="active"><a href="#">News</a></li>
          <li><a href="#">Bio</a></li>
          <li><a href="#">Friends</a></li>
          <li><a href="#">Media</a></li>
        </ul>
        <div class="profile">
          <img src="logo.png">
          <p class="name">Believemy</p>
        </div>
      </div>
    </div>

We wrap our header in a container class that will define the dimensions (width and height) of the profile.

This header will also contain the profile's cover photo, which we will place in the background. Therefore, we use a second class, the informations-bar class, which will contain all the profile elements: the photo, the name, and the links.

 

Step 2

Now let's style the cover photo (.container):

CSS
.container {
      position: relative;
      margin: auto;
      width: 650px; height: 250px;
      background-image: url('banner.png');
      background-size: cover;
      border-radius: 5px;
      overflow: hidden;
    }

Be sure to set the container to position relative to be able to position our information bar with absolute positioning.

 

Step 3

Next is styling the information bar!

CSS
.informations-bar {
      position: absolute;
      bottom: 0;
      width: 100%;
      height: 65px;
      background-color: #151728;
    }
    
    ul {
      list-style: none; padding: 0; z-index: 2;
    }
    
    ul li {
      text-align: center;
      animation: .3s print;
    }
    
    li a {
      text-decoration: none; font-size: 3em;
      text-transform: uppercase;
      font-weight: bold; font-family: arial;
      color: white;
    }
    
    ul li a:hover { color: #ff9234; }
    
    .open {
      display: flex;
      justify-content: center;
      align-items: center;
    }

A bit longer, but still simple. We will create an animation later, which is why we call an animation in the li tag named print.

You can also note that there is an open class that serves no purpose at the moment. This class will be added using JavaScript to open our menu. We are also using flexbox to horizontally and vertically center all the menu links.

 

Step 4

Now let's move on to our backdrop class and thus to our shadow! Here, nothing very new—we will position the class as absolute and set "top", "left", "right", and "bottom" to 0 to make it cover the entire page. We will also use an animation to make the shadow appear, which we will call fade.

CSS
.backdrop {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: rgba(0, 0, 0, .9);
      cursor: pointer;
      animation: fade .1s;
    }

 

Step 5

Our design is now complete; we just need to create the animations to display our beautiful menu with a final class.

CSS
@keyframes print {
      from {
        margin-top: -50px; opacity: 0;
      }
      to {
        margin-top: 0; opacity: 1;
      }
    }
    
    @keyframes fade {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

 

Step 6

Now all that's left is to make everything work using JavaScript.

JAVASCRIPT
const button = document.querySelector('button');
    const nav = document.querySelector('nav');
    const backdrop = document.querySelector('.backdrop');
    
    button.addEventListener('click', () => {
      nav.classList.add('open');
    });
    
    backdrop.addEventListener('click', () => {
      nav.classList.remove('open');
    });

When the "Menu" button is clicked, we add the open class to our navigation bar, which will make it appear.

If the user clicks on the shadow (backdrop), we remove the open class and hide the navigation bar.

Category: Developers

Share this article

Want to help us? Share this article on your networks or even better: on your site, in an article or in your newsletter.

Believemy logo
Comments (0)

You need to be logged in to comment on this article: log in or sign up.

Read next

Creating text with integrated background

If you're looking for a very modern and effective way to style your headlines, take a look at how using a background to style the colour of your text can be incredibly innovative.

December 9, 2024

Create a clean, modern timeline using html and css

Whether you want to show a purchasing process, the highlights of your career on your portfolio, or anything else, learn how to create a sleek, modern timeline to show it off!

December 9, 2024

Generate images with Midjourney - the complete guide

Creating images with artificial intelligence: this has become the big trend of 2023. Whether for video, photos, text content or music. One of the most popular services is called Midjourney. So we've decided to put together a huge, packed guide to help you generate your own images too!

December 9, 2024

Where to start with web development?

Creating your own website is a very rewarding experience: the feeling of creating something that didn't exist before with your hands on a keyboard has always amazed me. But where to start in web development? That's what this article is all about!

December 4, 2024

Create a social network sharing button

For your blog posts or on the pages that present your projects from a portfolio, presenting a modern, non-intrusive button to allow your visitors to share your website or go to your social networks is ideal. Let's look at how to create this type of button together in this article.

December 9, 2024

Create a text rotation effect

To make your site more attractive, you could add this cool effect, which will display several words in succession with a looping deletion and rewriting effect. This effect can be placed at the end of a sentence, as in a text.

December 11, 2024

Twitter Algo 101: understanding the factors influencing your visibility in 2025

Twitter is one of the most popular social networks in the world, with millions of active users engaging daily. However, what many users may not be aware of is the complex algorithm that governs content recommendations and prioritisation on the platform. In this article, we're going to delve into the inner workings of Twitter's algorithm and how it decides what content to show users. More specifically, we'll look at the different factors that can have a positive or negative impact on the visibility of a tweet.

December 9, 2024

Create a heartbeat button

For a main button or even for a button you want to highlight, offering this heartbeat effect can give your website a very modern feel. Find out how in this article.

December 6, 2024

Become the solopreneur you dream of being.

First project, career change, business launch: access our courses, practice on real-world cases, and move forward with clear guidance.