0

How doo you style the text you can choose to be written on your website in javascript with css?

14th Jul 2018, 6:53 PM
Frans
13 Answers
+ 2
There are plenty of ways.Example: you can create class on CSS page like .text-style and give that on HTML page class or you can just do everything on HTML page and example for h2 do: h2{ font-family: Monospace; } I hope i helped you.
14th Jul 2018, 8:06 PM
Kalaba
Kalaba - avatar
+ 3
so if you make something in js as text you give it an element type using append and stuff like that and in css put the element{ style:; }
14th Jul 2018, 9:49 PM
Emperor Bob
Emperor Bob - avatar
+ 1
<p id="text"> The text </p>
14th Jul 2018, 7:51 PM
Dlite
Dlite - avatar
+ 1
i mean this text: var mystring1 = "I am learning "; document.write(mystring1);
14th Jul 2018, 7:53 PM
Frans
+ 1
Frans var text= "<h3> Text </h3>" document.write(text)
14th Jul 2018, 8:01 PM
Dlite
Dlite - avatar
0
Frans Please use CSS
14th Jul 2018, 7:29 PM
Dlite
Dlite - avatar
14th Jul 2018, 7:29 PM
Frans
0
#text { color:red; }
14th Jul 2018, 7:30 PM
Dlite
Dlite - avatar
0
so i can use that in the <script> section?
14th Jul 2018, 7:31 PM
Frans
0
No sir, rather use <style> =================== <style> .text{ color:red; } </style>
14th Jul 2018, 7:33 PM
Dlite
Dlite - avatar
0
but can i give some text an id when its written in javascript?
14th Jul 2018, 7:34 PM
Frans
0
You can give it an ID
14th Jul 2018, 7:47 PM
Dlite
Dlite - avatar
0
can you show me?
14th Jul 2018, 7:48 PM
Frans