All posts tagged font

Using CSS3 font-face To Add Custom Fonts To Your Website

One of the biggest features in CSS3 is the ability to use custom fonts in your web designs. In this tutorial, I’ll show you how to do just that using the free font Aller Display. Once you have downloaded the file, upload it to your server and note the location.

Live Demo

Here’s What The CSS Looks Like

The first step is to setup the @font-face selector with the font you want to use. For this example, I’m using the free font Aller Display. The font-family property declares the name/value for your custom font. The src property is the link to the font file on your server, which you have already uploaded.

@font-face {
 font-family: aller-display;
 src: url('aller-display.ttf');
}

Continue Reading

Adding An Outline To Your Text Using the CSS3 text-stroke Property

In this tutorial I’ll show you how to add an outline, or stroke, to your text using the CSS3 text-stroke property.

Live Demo

Here’s What The CSS Looks Like

The first step is to declare a text color, I’ve picked red here. Next, we use the text-stroke property to assign a color (black) and weight (1px). For this example, I’ve created a class called .stroke.

.stroke {
 color: #c00; /* text color */
 -webkit-text-stroke: 1px #000; /* stroke color and weight */
}

Continue Reading