Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Does anyone know all the classes for the code tag?
- mybearworld
-
1000+ posts
Does anyone know all the classes for the code tag?
<!-- Code tags are implemented like this: --> <!DOCTYPE html> <body> <div class="code"> <pre> <span class="c"><!-- Code tags are implemented like this:--></span> <span class="cp"><!DOCTYPE html></span> <!-- and so on --> </pre> </div> </body>
Does anyone know all of them?
Thanks to #5 for the answer!
Last edited by mybearworld (May 28, 2022 14:05:49)
- MagicCrayon9342
-
1000+ posts
Does anyone know all the classes for the code tag?
The class names do not pertain to the code itself from the looks of it, rather it pertains to how the code is displayed? The class names are probably for the syntax highlighting. The ‘pre’ tags probably keep the code in the exact layout and format that the user input it. The class ‘code’ probably resembles code blocks.As you can see, the class names are quite cryptic. I tried to look for an explenation, but failed.<!-- Code tags are implemented like this: --> <!DOCTYPE html> <body> <div class="code"> <pre> <span class="c"><!-- Code tags are implemented like this:--></span> <span class="cp"><!DOCTYPE html></span> <!-- and so on --> </pre> </div> </body>
Does anyone know all of them?

Templates:
Doesn't belong in the ATs:
Unfortunately, this post does not belong in the Advanced Topics. Please report your post, and in the box type the following:Please move this post to ‘Thinks I’m Making or Creating' or ‘Show and Tell’
- mybearworld
-
1000+ posts
Does anyone know all the classes for the code tag?
I know, but is there a way we know all of them? The class names do not pertain to the code itself from the looks of it, rather it pertains to how the code is displayed? The class names are probably for the syntax highlighting. The ‘pre’ tags probably keep the code in the exact layout and format that the user input it. The class ‘code’ probably resembles code blocks.
- MagicCrayon9342
-
1000+ posts
Does anyone know all the classes for the code tag?
I can only assume html comments have the class ‘c’I know, but is there a way we know all of them? The class names do not pertain to the code itself from the looks of it, rather it pertains to how the code is displayed? The class names are probably for the syntax highlighting. The ‘pre’ tags probably keep the code in the exact layout and format that the user input it. The class ‘code’ probably resembles code blocks.
and the DocType tag has the class ‘cp’
You can write every syntax highlighting type into a code tag and see how it renders to know the classes.

Templates:
Doesn't belong in the ATs:
Unfortunately, this post does not belong in the Advanced Topics. Please report your post, and in the box type the following:Please move this post to ‘Thinks I’m Making or Creating' or ‘Show and Tell’
- Mrcomputer1
-
500+ posts
Does anyone know all the classes for the code tag?

——————–
Progress bar to 1000+ Posts - Image might not be up to date


——————–
My browser / operating system: Windows NT 10.0 (Windows 11 - 21H2), Firefox 102.0b9
——————–
My ScratchX Extensions——–If you like this post, give me an internet!——–Sharp Scratch Mod
- Discussion Forums
- » Advanced Topics
-
» Does anyone know all the classes for the code tag?