Continuation of the original 20 CSS tricks article.
Creating a Sticky Header: Set the header's position to
sticky
and specify the top position to make it stick to the top of the viewport while scrolling.Creating Custom Cursors: Use the
cursor
property to change the default cursor to a custom image or shape.Creating a Typewriter Effect: Use CSS animations and
@keyframes
to simulate a typewriter effect on text.Creating a Vertical Timeline: Utilize
display: flex;
ordisplay: grid;
to create a vertical timeline layout.Creating a Loading Spinner: Use CSS animations or an SVG animation to create a loading spinner.
Creating a Blur Background Effect: Apply the
backdrop-filter: blur();
property to create a blur effect on the background of an element.Creating a Print-Friendly Layout: Use
@media print
to define CSS styles specifically for printing.Creating a Gradient Border: Use the
border-image
property with a gradient to create a gradient border around an element.Creating a CSS Grid Layout: Utilize the CSS
grid
property to create complex grid-based layouts.Creating a Multi-column Layout: Use the
column-count
property to create multiple columns of content.Creating a Zoom Effect on Images: Apply the
transform: scale();
property to create a zoom effect on images.Creating a Notification/Alert Box: Use CSS and HTML to create a custom notification or alert box.
Creating a Text Shadow Effect: Apply the
text-shadow
property to add a shadow effect to text.Creating a Fixed Background Image: Use
background-attachment: fixed;
to create a fixed background image that remains in place while scrolling.Creating a Text Gradient Effect: Use the
-webkit-background-clip: text;
and-webkit-text-fill-color: transparent;
properties to apply a gradient effect to text.Creating a Transparent Background: Utilize
background-color: transparent;
orrgba()
to create a transparent background on an element.Creating a Flip Animation: Use the
transform
andtransition
properties to create a flip animation on an element.Creating a Bouncing Animation: Utilize CSS keyframes and the
animation
property to create a bouncing animation effect.Creating a Hamburger Menu: Use CSS to create a responsive hamburger menu icon that expands into a full navigation menu.
Creating a Circular Progress Bar: Use the
border-radius
property and CSS animations to create a circular progress bar.
Top comments (0)