Original Post
I'm writing some C++ tutorials to put up on a website but having trouble getting some code elements to display properly since they're interpreted as HTML tags. I'm using the pre tag so it'll be easy to paste the code within the tag without having to reformat it. But since it allows tags within it some elements which contains < and > gets messed up. Example on messed up code ( and anything after "Sometext." < isn't displayed): pre.code definition: I was glad to find the xmp tag which basically did what I wanted but it was also deprecated [depressed] I find it strange the xmp tag was replaced with the pre tag because to me it seems like the pre tag has different features? Do you know of a better way to do this? Thanks for any suggestions.
#include <iostream>
int main(int argc, char** argv)
{
cout <<"Sometext." <<endl;
return 0;
}
pre.code
{
background-color:#FFF1CD;
font-family:courier, serif;
font-size:10px;
font-style:normal;
margin:10px;
padding:0px
}