Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using @font-face in HTML style attribute (CSS inline style) not working

I want to use Devlys010 font in my HTML textarea.

I have downloaded ttf for the same and copy it in the project folder.

In textarea code I'm using the following code:

<textarea class="form-control" name="question" style="font-family:DevLys_010; src: url('mfdev010.ttf');"></textarea>

But it is not showing the devlys font while typing in the text box.

Please help me how can I use this?

like image 793
Rohitashv Singhal Avatar asked Oct 25 '25 21:10

Rohitashv Singhal


1 Answers

Call your font from the style element in your head section, or from an external CSS file.

I don't believe you can load the file from the style attribute.

Try something along these lines:

<html>
    <head>
        <title> text here </title>
        <style>
            @font-face {
                font-family: "DevLys_010";
                src: url("https:// path here / path here /mfdev010.ttf");
            }
            textarea {
                font-family: DevLys_010;
            }
        </style>
    </head>
    <body>
        <textarea class="form-control" name="question"></textarea>
    </body>
</html>
like image 175
Michael Benjamin Avatar answered Oct 27 '25 10:10

Michael Benjamin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!