I have a website or a html page and I want to indent my code for my visitors to see. For example:
<html>
<head>
</head>
<body>
<pre>
<html>
<body>
<p>
hi
</p>
</body>
</pre>
</body>
</html>
In html, is there a way to indent a block code without using a lot of   ; , like the <blockquote> tag. this way, I can use something like this:
<html></html> Using:<head> </head> <body></body><p> Hi</p>
<blockquote>
<html>
<blockquote>
<head>
</head>
<body>
<blockquote>
<p>
<blockquote>
Hi
</blockquote>
</p>
</blockquote>
</body>
</blockquote>
</html>
I was wondering if there was a better way to indent blocks of code. If not, I was wondering if there was a way to use css to change it so there is no line on the side and it looks just link a normal indent to the user.
You can use the pre tags to make preformatted text which can be indented via normal spaces/tabs.
<pre>
<html>
<head></head><body>
<p>
Hi
</p>
</body>
</html>
</pre>
JSFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With