- Published on
6 Tips To Build A Landing Page With Twinkling Stars 🌟 With Tailwind CSS

- What is Tailwind CSS?
- The description of Landing Page with twinkling stars 🌟 ui component
- Why use Tailwind CSS to build a Landing Page with twinkling stars 🌟 ui component?
- The preview of Landing Page with twinkling stars 🌟 ui component
- The source code of Landing Page with twinkling stars 🌟 ui component
- How to build a Landing Page with twinkling stars 🌟 with Tailwind CSS?
- Install tailwind css of verion 1.2.0
- All the unility class needed to build a Landing Page with twinkling stars 🌟 component
- 16 steps to build a Landing Page with twinkling stars 🌟 component with Tailwind CSS
- Conclusion
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.
The description of Landing Page with twinkling stars 🌟 ui component
This is the first section of one of my future templates. you need a little bit of js! :) also, i recommend to add a script that auto-reload the page on resize, to avoid blank space! simple and clear.
Why use Tailwind CSS to build a Landing Page with twinkling stars 🌟 ui component?
- It can make the building process of Landing Page with twinkling stars 🌟 ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Landing Page with twinkling stars 🌟 component file.
The preview of Landing Page with twinkling stars 🌟 ui component
Free download of the Landing Page with twinkling stars 🌟's source code
The source code of Landing Page with twinkling stars 🌟 ui component
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<style>
.star {
position: absolute;
width: 2px;
height: 2px;
border-radius: 5px;
}
@keyframes twinkle {
0% {
transform: scale(1, 1);
background: rgba(255, 255, 255, 0);
animation-timing-function: linear;
}
40% {
transform: scale(0.8, 0.8);
background: rgba(255, 255, 255, 1);
animation-timing-function: ease-out;
}
80% {
background: rgba(255, 255, 255, 0);
transform: scale(1, 1);
}
100% {
background: rgba(255, 255, 255, 0);
transform: scale(1, 1);
}
}
</style>
<section
class="homescreen m-0 flex flex-col w-screen justify-center bg-gray-800 h-screen text-gray-100 "
>
<nav>
<ul class="flex justify-between text-xl py-8 px-8 md:px-48 ">
<li>
LOGO
</li>
<li>
<a href="https://github.com/Icesofty" target="_blank" rel="noopener noreferrer">Made with 💚 by IceSofty</a>
</li>
</ul>
</nav>
<h1 class="text-6xl my-auto mx-auto md:mx-48 ">
Delightful <br />
<span class="text-teal-400">Web Templates.</span>
</h1>
</section>
<script>
for (var i = 0; i < 100; i++) {
var star =
'<div class="star m-0" style="animation: twinkle ' +
(Math.random() * 5 + 5) +
's linear ' +
(Math.random() * 1 + 1) +
's infinite; top: ' +
Math.random() * $(window).height() +
'px; left: ' +
Math.random() * $(window).width() +
'px;"></div>';
$('.homescreen').append(star);
}
</script>
How to build a Landing Page with twinkling stars 🌟 with Tailwind CSS?
Install tailwind css of verion 1.2.0
Use the link
html tag to import the stylesheet of Tailwind CSS of the version 1.2.0
<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">
All the unility class needed to build a Landing Page with twinkling stars 🌟 component
m-0
flex
flex-col
w-screen
bg-gray-800
h-screen
text-gray-100
text-xl
py-8
px-8
md:px-48
text-6xl
my-auto
mx-auto
md:mx-48
text-teal-400
16 steps to build a Landing Page with twinkling stars 🌟 component with Tailwind CSS
Control the margin on all sides of an element to 0rem using the
m-0
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Use
w-screen
to make an element span the entire width of the viewport.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Use
h-screen
to make an element span the entire height of the viewport.Control the text color of an element to gray-100 using the
text-gray-100
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the vertical padding of an element to 2rem using the
py-8
utilities.Control the horizontal padding of an element to 2rem using the
px-8
utilities.Control the horizontal padding of an element to 12rem at only medium screen sizes using the
md:px-48
utilities.Control the text color of an element to 6xl using the
text-6xl
utilities.Control the vertical margin of an element to auto using the
my-auto
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the horizontal margin of an element to 12rem at only medium screen sizes using the
md:mx-48
utilities.Control the text color of an element to teal-400 using the
text-teal-400
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to build a Landing Page with twinkling stars 🌟 components, learn and follow along to implement your own components.