Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Monospace font not displaying correctly on server

I am trying to display a set of alphanumeric characters, one per line, and wanted to have them line up properly, so I used monospace font. It works fine when I try it locally (run from within Visual Studio, for example) but when I deploy the application it doesn’t work. I am hoping it is not some browser setting because I cannot ask user to modify their browser settings.

This is the CSS:

.monoSpace {
    font-family: monospace;
    font-size: .75em;
    font-style: normal;
    font-variant: normal;
    font-weight: 400;
}

textarea using this style:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<textarea id="taLabelIDs" name="taLabelIDs" class="monoSpace w-100" cols="40" rows="6"></textarea>

This is what it looks like run locally:

Local version

This is what it looks like on server:

On server

>Solution :

As you have given only monospace and not a certain font name, most probably your machine and the server use different default monospace fonts. Try to use for example font-family: ‘Courier’, monospace; to see if three is still any difference.

You could use any other monospace font, just first check the web-safe monospace fonts on the net.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading