2
A "picture" says more than many words is not true!? Then I invite you to see the:
Example
In this image we see some "tags" formatted in colors "red(red), brown(Maroon) and blue(Skyblue)"
What I want with this is to do what an HTML program/software editor already does. That is, the whole process that highlights the tags.
See a code for example just below handmade:
Code
function Tag()
{
// Faz alguma coisa para setar as cores
...
// Fim de rotina cores sortidas
}
Tag();
div.code
{
border: thin solid silver;
width:720px;
height:390px;
}
<div class="code">
<pre>
01 - <!DOCTYPE html>
02 -
03 - <html lang="en">
04 - <head>
05 - <meta charset="utf-8"/>
06 - <title>Centralizar DIV</title>
07 - <link href="centralizar.css" rel="stylesheet" type="text/css"/>
08 - </head>
09 - <body>
10 -
11 - <div id="site">
12 -
13 - <h1>Edu??o superior na regi??o de camplinas</h1>
14 -
15 - <p>Resultado do Censo 2010 mostra o percentual da popula??o
16 - das cidades da regi?o de Camplinas com forma??o superior.
17 - Compara??o com a m?dia do estado de SP e nacional</p>
18 -
19 - <img src="grafico.jpg" alt="Gr?fico"/>
20 -
21 - </div>
22 -
23 - </body>
24 -
25 - </html>
</div>
We know that this is useful for writing articles and showing an excerpt of the code in a prominent and well presented way on the Site/Blog.
Reminder
I’m not looking to modify text colors, but rather, the color of HTML tags, is totally the opposite of the concept of styling an element with CSS.
Doubt
How will I do this effect, from "image" to "code"?
Where do you want to apply your idea?
– EmanuelF
@What do you mean, Emanuelf? Note what says "[...] is useful for writing articles and showing an excerpt of the code in a highlighted and well presented way on the Site/Blog.", understood?
– Diego Henrique
Now it’s clearer, so you want to create a field where tags are highlighted in different colors? Something you used here to exemplify your idea?
– EmanuelF
@Emanuelf That’s right, I like to create everything by hand and do not use HTML editors. So, it would be interesting and functional to create an external routine to pre-format small chunks within a DIV.
– Diego Henrique