html - How do I show a snippet of code or a block of code followed by an example of the code? -


i learning basics of xhtml , attempting use tag code , pre display snippets or blocks of code respectively. how show working example of code e.g.

<p>code sample</p> <code> #p1 {font-family: arial;} </code> 

how display working example of code below it?

you won't able map kind of code actual html/css using html/css alone. try using javascript achieve this, mileage may vary haven't done kind of thing before.

when wrote html/css articles code examples + working samples you're doing, used write style attributes containing example css, or style sample elements id, manually, i'm not sure if you're looking kind of solution.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -