0
How to use <code> tag?
how to use <code> tag in HTML
3 ответов
+ 11
It's just another text element that styles the inner text to look like a piece of code... Just styling nothing special...
<code>Text</code>
+ 1
By this you can define a piece of code
- 1
The <code> tag is used to display blocks of code. The correct way to use it (as far as I know) is:
<pre>
<code>
puts "hello!"
</ code>
</ pre>
There are many tutorials on how to add syntax highlighting with pygments, highlight.js, etc.
https://scotch.io/tutorials/get-beautiful-syntax-highlighting-for-your-website-code