I want to embed my C code in the HTML page, but the HTML format will only keep the text to the left. As follows:
HTML
<style type="text/css">
.codebox {
color: rgb(230, 230, 210);
width: 700px;
height: 100%;
padding-top: 2px;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 2px;
background-color: rgb(170, 150, 190, 0.37);
border: 2px solid rgb(170, 150, 190);
border-radius: 5px;
}
</style>
<div class="codebox">
int main(int argc, char **argv)
{
size_t x;
for(x = 0; x < 256; ++x) {
...
}
return 0;
}
</div>
But the actual effect is as follows:
int main(int argc, char **argv)
{
size_t x;
for(x = 0; x < 256; ++x) {
...
}
return 0;
}
I know can use the "pre" tag, but this will make all the formats be rendered.
I am not familiar with the knowledge of the web front end. I hope you can help me.