Have White Text With A Black Border Css

CSS Programming

Have you ever come across a webpage with eye-catching text that has white text with a black border? I must admit, the first time I saw it, I was immediately drawn to it. It adds a unique touch to any website and makes the text stand out. In this article, I will guide you through the process of achieving this effect using CSS. So, let’s dive into the world of white text with a black border!

The Basics of CSS

CSS, also known as Cascading Style Sheets, is a powerful tool for designing and styling webpages. It allows you to control the layout, colors, fonts, and other visual aspects of HTML elements. To implement the white text with a black border effect, we will be using CSS properties to define the styling of the text.

Setting Up the HTML Structure

Before we start styling our text, let’s create a basic HTML structure for our webpage. Here’s an example:

    <title>White Text with Black Border</title>
    <h1>My Awesome Webpage</h1>

Styling the Text

Now, let’s dive into the CSS part and style our text with a white color and a black border. We will use the following CSS properties:

h1 {
  color: white;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;

Let’s break down what each property does:

  • color: white; sets the text color to white. This will make our text appear white.
  • text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; creates a black border around the text by adding multiple text shadows. Each text shadow offsets the shadow by a certain amount of pixels, giving the appearance of a border.

Adding Personal Touches

Now that we have the basic implementation, it’s time to add some personal touches and commentary to make our webpage unique. You can modify the CSS properties to suit your design preferences. For example, you can change the color of the text to any other color or experiment with different shadow offsets to create different border effects.

Additionally, you can apply this effect to other HTML elements, such as paragraphs, headings, or even links. Get creative and make your webpage truly your own!


Implementing white text with a black border using CSS is a great way to make your webpage visually appealing and stand out from the crowd. By using the color and text-shadow properties, you can easily achieve this effect. Remember to add your own personal touches to make your webpage unique.

So, go ahead and experiment with this technique. Have fun creating stunning webpages with white text and black borders!