Making an Underwater CSS Text Effect

Category Image 076

Web design can serve as a playful exploration ground for learning new techniques. In today’s guide, we’ll dive into the creation of an underwater CSS text effect, not just for the visual outcome, but to deepen our understanding of how different CSS properties harmonize to create dynamic text effects.

Your Web Designer Toolbox

Unlimited Downloads: 500,000+ Web Templates, Icon Sets, Themes & Design Assets
Starting at only $16.50/month!


Setting up the Structure

Our journey into the deep sea starts with a simple HTML structure: a div element with the class underwater, wrapping around an h1 tag.

<div class=”underwater”>
<h1>1stWebDesigner</h1>
</div>

Achieving the Underwater Effect

For our underwater CSS text effect, we introduce a range of CSS properties such as background-image, animation, and -webkit-background-clip.

@import url(‘https://fonts.googleapis.com/css2?family=Maven+Pro:wght@700&amp;display=swap’);

body{
/* Using a dark background color for optimal contrast */
background-color: #000;
font-family: ‘Maven Pro’, sans-serif;
}

.underwater h1{
/* Font settings: sizing and a semi-transparent color */
font-size: 2.5rem;
color: #2c3e5010;

/* Assigning an underwater image as the background */
background-image: url(‘https://w7.pngwing.com/pngs/183/509/png-transparent-under-water-scenery-sunlight-underwater-ray-star-ocean-atmosphere-cloud-computer-wallpaper.png’);

/* Clipping the background image to the outline of the text */
-webkit-background-clip:text;

/* Setting a 10s infinite animation for a dynamic effect */
animation: waterEffect 10s infinite;
}

/* Animation to simulate flowing water */
@keyframes waterEffect {
0% { background-position: left 0 top 0; }
100% { background-position: left 100% top 0; }
}

Explaining Key CSS Properties and Values

Breaking down our CSS code, the first point of interest is the background-image property. By setting an underwater image as the background, we immediately set the tone for our effect.

The -webkit-background-clip:text property clips the background image to the shape of the text. It allows the underwater image to fill the text, setting the stage for our effect.

The color property plays a vital role as well. We’re using a semi-transparent color (color: #2c3e5010;), where the last two digits 10 represent the alpha channel in hexadecimal format, controlling the transparency. This enables the background image to shine through, enhancing the underwater illusion.

The animation property sets our waterEffect animation into motion. Defined by the @keyframes rule, it continuously shifts the background-position from left 0 top 0 to left 100% top 0, creating the illusion of water flowing over the text.

The Result

See the Pen
Underwater Text Effect by 1stWebDesigner (@firstwebdesigner)
on CodePen.

Exploring Other Methods

Different methods can achieve similar effects. An alternate approach involves utilizing the clip-path property with CSS animations, yielding a wavy text appearance akin to an underwater CSS text effect. This method manipulates the clip region of an element over time, evoking a dynamic sense of movement reminiscent of water’s rhythmic flow. In addition, the technique doesn’t necessitate a background image, instead, it transforms the appearance of the text directly. By turning to this method, you’re exposed to yet another aspect of CSS and its potential for dynamic text effects.

How to Limit Post Revisions in WordPress

Featured Imgs 23

Optimizing your WordPress workflow often involves tweaking a few settings and functions. One of these features is post revisions. This built-in functionality can be a lifesaver, especially when you want to revert changes or restore an earlier version of a post. However, having an excessive number of revisions can be overwhelming and may clutter your database.

We’ll guide you through the steps to limit post revisions in WordPress, without turning to specific plugins.

Kinsta

Understanding WordPress Post Revisions

Post revisions, a core feature of WordPress, allows you to undo changes and revert to previous versions of your posts or pages. For every draft in progress, WordPress automatically generates a temporary revision (known as an auto-save) every 60 seconds. It supersedes older versions with these new auto-saves.

Alongside auto-saves, WordPress creates permanent revisions each time a user hits save, update, or publish. These permanent revisions are stored in the WordPress database and can be managed from the post-edit screen.

Why Would You Limit Post Revisions?

Limiting post revisions does not necessarily mean you’re capping your site’s performance. WordPress intelligently excludes post revisions from the database calls on the front end, only including them on the post-edit screen or while browsing revisions.

However, having a large number of post revisions can cause your WordPress database to become bulky, and although it won’t affect your site’s performance, it may make you feel a bit disorganized. Keeping your database clean and neat is good practice and can make your backend operations smoother.

The Manual Approach

Now, let’s jump into how you can limit post revisions manually in WordPress without the use of plugins.

Restricting the Number of WordPress Post Revisions

WordPress enables you to control the number of revisions retained for an article. To set a limit, you’ll need to add a specific line of code to your WordPress site’s wp-config.php file.

define( 'WP_POST_REVISIONS', 7 );

In the above code snippet, replace “7” with the desired number of revisions you wish to store for each post. Remember to save and close the file after making your adjustments.

How to Completely Turn Off WordPress Post Revisions

If your objective is to entirely disable post revisions, WordPress allows for this as well. By incorporating the following line of code into your wp-config.php file, you can turn off the post revision functionality:

define('WP_POST_REVISIONS', false );

Specifically, this command will deactivate the post revisions feature on your website. However, it’s crucial to understand that WordPress will continue to preserve one auto-save and one browser-stored revision despite this change.

Wrapping Up

Fine-tuning how post revisions are handled in WordPress can lead to a tidier database and a more streamlined content production process. It’s worth noting that manipulating core files requires a basic level of comfort with code or additional guidance. For related WordPress management topics, feel free to check out our guide on managing widgets in your WordPress dashboard.

Twelve Pitfalls To Avoid in Data Integration

Featured Imgs 23

Data integration can be a tricky business, like navigating a maze filled with dead-ends, detours, and pitfalls. But fear not! With the right map and tools, you can reach the end of the maze successfully. To help you get there, we've outlined the top 12 common pitfalls to watch out for in your data integration journey. So buckle up, and let's embark on this exciting and fun adventure together!

Are Data Format Mismatches Messing With Your Integration Goals?

Picture this: you've finally reached the heart of the data integration maze and are ready to integrate your data sources. You expect a seamless data flow, but instead, you're met with a roadblock - data in different formats. It's like discovering that your GPS uses metric while the map you have is in imperial. It just doesn't match!

This is a common issue when integrating data from different sources. For example, one data source might use the MM/DD/YYYY date format, while another uses DD/MM/YYYY. If these mismatches are not addressed, they can cause errors and prevent you from reaching the end goal of seamless data integration.

To avoid this pitfall, you must get your data in the same format before integrating it. Think of it as a translator, converting data from one language to another, making sure that everyone can understand each other.

What’s New in HMS Core Scan Kit 6.11.0

Featured Imgs 23

The latest version (6.11.0) of HMS Core Scan Kit is now available, and this article aims to share some of its exciting new features with you:

  • The kit adds the decode API that is available to both camera-based and image-based barcode scanning scenarios.

This API supports image data in NV21 format (which is output by your custom camera API) and multi-barcode recognition. Compared with decodeWithBitmap, an API released in an earlier version that supports only the bitmap format, the decode API saves time converting the image format and delivers a faster barcode scanning process in the camera-based mode.