user2464246
user2464246

Reputation: 39

How do I set the width and height of a character in CSS

I am currently trying to make a page where all of the character's widths and heights are the same.

Upvotes: 0

Views: 6192

Answers (3)

Xedret
Xedret

Reputation: 1901

* {
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 4px;
    line-height: 10px;
}

This should make all the text the same height, spacing and family.

Upvotes: 1

Schleis
Schleis

Reputation: 43790

In order to do this for all characters you will want to use a mono-space font and set the font-size to 1em. An em is equal to the width of the letter 'm' in the font and size all the letters are the same width, you will have them be same height and width.

Upvotes: 0

tckmn
tckmn

Reputation: 59363

You can't do that, but you can use a monospace font and set the height you want:

#something {
    font: (the height you want it to be)px monospace;
}

Here is a fiddle.

It will look like this:
image

Upvotes: 2

Related Questions