This is my first time playing with html. I have this code that should display a simple pice of ascii art.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
flex-direction: column; /* Ensures elements stack vertically */
font-family: Arial, sans-serif;
}
hr {
width: 100%; /* Ensures the hr spans the full width */
}
</style>
</head>
<body>
<hr>
<p style="text-align: center">
_//| <br>
//##|| <br>
|__ //####|| <br>
||##\__ //## || <br>
||######\________//## || <br>
|| ############# || <br>
|| || <br>
|| ##\ <br>
|| ##\ <br>
|| ##\ <br>
|| ||________ <br>
|| //\ || \ <br>
|| //\ //####\ || \ <br>
|| //####\ \## // || \ <br>
|| \## // \// || ______ || <br>
//\ \// || // \____|| <br>
//####\__ //__// ##\<br>
|| \____ __//## ##||<br>
|| \________// ||<br>
|| ||<br>
|| ||<br>
|| ||<br>
|| || <br>
\ || <br>
|| // <br>
\ // <br>
\__ __// <br>
\______________________________// <br>
</p>
<hr>
</body>
</html>
However the result looks like this:
Why is the browser ignoring the spaces? It’s not doing it when I write normal text.
2
you need use HTML tags < pre >you code or text< /pre >
New contributor
mrStrike is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.