L
L
Lukash_Dynamics2021-06-24 14:25:58
css
Lukash_Dynamics, 2021-06-24 14:25:58

How to include an external CSS file in a script?

The situation is as follows:
There is a script on the page, according to the model:

<script>
  ********** = function () {
  *********** = "";
};
</script>

In quotation marks, text \ tags are set to visually change the text. Is it possible to include an external CSS file here? If so, how?
If not, how can I write my own font here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Korenevsky, 2021-06-24
@Dier_Sergio_Great

In JavaScript, create a variable with the string
A and then add this string using document to the page itself

let font = "<link href='стиль.css' rel='stylesheet'>";
document.append(font);

The fact is that you cannot directly connect the font separately, it is possible only if the font inside the CSS is specified.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question