Blocked and preserved Code : code « Tags « HTML / CSS






Blocked and preserved Code

    


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
<style type="text/css" media="Screen">
* .blocked {
  display: block;
}

* .preserved {
  white-space: pre;
}

</style>
</head>
<body>
<p>
    <code class="blocked preserved"> 
    
    *.blocked { display:block; } 
    *.preserved { white-space:pre; } 
    *.code { font-family:monospace; } 
    
    
    </code> 
</p> 


</body>
</html>

   
    
    
  








Related examples in the same category

1.code Element For Adding Code to Your Web Pages
2.code must be within pre (inline elements can't contain block-level elements)
3.Displaying blocks of code online
4.Formula input
5.code margin: 5px 0;
6.code padding: 10px;
7.code text-align: left;
8.code display: block;
9.code overflow: auto;
10.code font: 500 1em/1.5em 'Lucida Console', 'courier new', monospace ;
11.code background: #F5F5F5;
12.code border-left: 3px solid #D4D4D4;
13.code font-family:courier, monospace;
14.code font-size:12px;
15.code font-weight:bold;
16.code border:1px solid #000000;
17.code {display:block;}
18.code font-family: courier;
19.code color: #000000;
20.code font-size: smaller;
21.code background-color: #d6d6d6;
22.code padding: 2px;
23.code margin: 5px;
24.code padding: 3px;
25.code background-color: black;
26.code color: #FFFFFF;
27.Code style
28.'code' Example