Site logo

Archived topic

Top Bar like GP

3 replies · Started by Sanu Kumar on November 29, 2021

Viewing posts 1–4 of 4

How can I make a top bar like GP.
Top-Bar
I know you're using GenerateBlocks but how can I make that black background "Black Friday Sale" is written.

Hi there,

That can be done with GenerateBlocks but it also can be done with just custom HTML. (If I remember it right, the site itself uses custom HTML. It's certainly not using GenerateBlocks for this.)

The "Black Friday sale!" is a span element with class sale-name and is styled with this:

.sale-name {
    background: #000;
    padding: 10px;
    display: inline-block;
    margin-right: 5px;
    font-weight: 700;
}

The entire HTML structure is:

<div class="flash-sale">
	<div class="grid-container grid-parent">
		<span class="sale-name">Black Friday Sale!</span> Get up to <strong><span class="dollar-sign">$</span>30</strong> off GP Premium! <a class="smooth-scroll" href="https://generatepress.com/pricing">Learn more ➝</a> <!--<span id="countdown"></span>-->
	</div>
</div>

Where the main element wrapper flash-sale is positioned sticky. Complete styling here:

.flash-sale {
    background: #f0544f;
    padding: 10px;
    text-align: center;
    color: #fff;
    border-bottom: 3px dashed #191b29;
    z-index: 200;
    position: sticky;
    top: 0;
}

thanks

No problem. :D

This archived topic is closed to new replies.